Re: CVS commit: src/lib/libc/arch/arm/gen

2012-03-21 Thread Joerg Sonnenberger
On Wed, Mar 21, 2012 at 09:05:36AM +, Hiroyuki Bessho wrote:
 Module Name:  src
 Committed By: bsh
 Date: Wed Mar 21 09:05:36 UTC 2012
 
 Modified Files:
   src/lib/libc/arch/arm/gen: _lwp.c
 
 Log Message:
 shut up lint(1)

So the question is still -- how much do we want to uglify our code?

Joerg


Re: CVS commit: src/lib/libc/stdlib

2012-03-21 Thread Alan Barrett

On Tue, 20 Mar 2012, Christos Zoulas wrote:

Modified Files:
src/lib/libc/stdlib: jemalloc.c

-static char*umax2s(uintmax_t x, char *s);
+static char*umax2s(size_t x, char *s);


If you change the argument type, then please also change the 
function name.  Right now, the name contains the string umax 
which imnplies that the function deals with uintmax_t upjects, but 
the function actually deals with size_t opjects.


--apb (Alan Barrett)


Re: CVS commit: src/lib/libc/arch/arm/gen

2012-03-21 Thread David Young
On Wed, Mar 21, 2012 at 10:44:35AM +0100, Joerg Sonnenberger wrote:
 On Wed, Mar 21, 2012 at 09:05:36AM +, Hiroyuki Bessho wrote:
  Module Name:src
  Committed By:   bsh
  Date:   Wed Mar 21 09:05:36 UTC 2012
  
  Modified Files:
  src/lib/libc/arch/arm/gen: _lwp.c
  
  Log Message:
  shut up lint(1)
 
 So the question is still -- how much do we want to uglify our code?

Joerg, please make a positive suggestion instead of sniping at
developers in this way.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: CVS commit: src/lib/libc/gen

2012-03-21 Thread David Laight
On Wed, Mar 21, 2012 at 10:28:32AM -0400, Christos Zoulas wrote:
 Module Name:  src
 Committed By: christos
 Date: Wed Mar 21 14:28:32 UTC 2012
 
 Modified Files:
   src/lib/libc/gen: setmode.c
 
 Log Message:
 fix argument order.

Matt should have used my sed script ...


David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src/lib/libc/arch/alpha/gen

2012-03-21 Thread Alan Barrett

On Wed, 21 Mar 2012, Havard Eidnes wrote:

Modified Files:
src/lib/libc/arch/alpha/gen: fpgetround.c fpsetround.c

Log Message:
Add some casts to get rid of bitwise op on signed value is non-portable
warning from lint.


I see no bitwise ops on signed values here.


-   return ((fpcrval.u64  58)  0x3);
+   return ((fp_rnd)(fpcrval.u64  58)  0x3);


fpcrval.u64 is uint64_t.  After the integer promotions,
it's still uint64_t (unless that's smaller than int, which is not 
the case for any existing NetBSD port).  After 58, it's still 
uint64_t.  0x3 is a signed int, but the usual arithmetic conversions

should convert it to uint64_t.

--apb (Alan Barrett)


Re: CVS commit: src/lib/libc/arch/alpha/gen

2012-03-21 Thread Nicolas Joly
On Wed, Mar 21, 2012 at 10:42:58PM +0200, Alan Barrett wrote:
 On Wed, 21 Mar 2012, Havard Eidnes wrote:
 Modified Files:
  src/lib/libc/arch/alpha/gen: fpgetround.c fpsetround.c
 
 Log Message:
 Add some casts to get rid of bitwise op on signed value is non-portable
 warning from lint.
 
 I see no bitwise ops on signed values here.
 
 -return ((fpcrval.u64  58)  0x3);
 +return ((fp_rnd)(fpcrval.u64  58)  0x3);
 
 fpcrval.u64 is uint64_t.  After the integer promotions,
 it's still uint64_t (unless that's smaller than int, which is not 
 the case for any existing NetBSD port).  After 58, it's still 
 uint64_t.  0x3 is a signed int, but the usual arithmetic conversions
 should convert it to uint64_t.

The commit message reference the wrong lint warning.

/local/src/NetBSD/src/lib/libc/arch/alpha/gen/fpgetround.c(61): warning: 
conversion from 'unsigned long' to 'enum unnamed' may lose accuracy [132]
/local/src/NetBSD/src/lib/libc/arch/alpha/gen/fpsetround.c(61): warning: 
conversion from 'unsigned long' to 'enum unnamed' may lose accuracy [132]

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: CVS commit: src/lib/libc/stdio

2012-03-21 Thread Christos Zoulas
In article 20120322003141.gb1...@britannica.bec.de,
Joerg Sonnenberger  jo...@britannica.bec.de wrote:
On Wed, Mar 21, 2012 at 10:20:47AM -0400, Christos Zoulas wrote:
 Module Name: src
 Committed By:christos
 Date:Wed Mar 21 14:20:47 UTC 2012
 
 Modified Files:
  src/lib/libc/stdio: vfwprintf.c
 
 Log Message:
 unsigned char portability casts

This looks wrong. What's the point of it?

What's is wrong with it?

christos



Re: CVS commit: src/lib/libc/stdio

2012-03-21 Thread Joerg Sonnenberger
On Thu, Mar 22, 2012 at 01:31:41AM +, Christos Zoulas wrote:
 In article 20120322003141.gb1...@britannica.bec.de,
 Joerg Sonnenberger  jo...@britannica.bec.de wrote:
 On Wed, Mar 21, 2012 at 10:20:47AM -0400, Christos Zoulas wrote:
  Module Name:   src
  Committed By:  christos
  Date:  Wed Mar 21 14:20:47 UTC 2012
  
  Modified Files:
 src/lib/libc/stdio: vfwprintf.c
  
  Log Message:
  unsigned char portability casts
 
 This looks wrong. What's the point of it?
 
 What's is wrong with it?

It should be unnecessary. CHAR_MAX is certainly required to fit into
both char and unsigned char.

Joerg


Re: CVS commit: src/lib/libc/stdio

2012-03-21 Thread Takehiko NOZAKI
Hi,

It seems that lint(1) is not cross build safe, it doesn't handle MD char
default type of sign/unsignd. See src/usr.bin/xlint/lint1/tree.c::cvtcon().
They use host MD CHAR_MAX directry ;)

So, if cross building ppc/arm on other arch cause false alarm , out of
range  warnng.

very truly yours.
-- 
Takehiko NOZAKItnoz...@netbsd.org

2012/3/21 Christos Zoulas chris...@netbsd.org:
 Module Name:    src
 Committed By:   christos
 Date:           Wed Mar 21 14:20:47 UTC 2012

 Modified Files:
        src/lib/libc/stdio: vfwprintf.c

 Log Message:
 unsigned char portability casts


 To generate a diff of this commit:
 cvs rdiff -u -r1.28 -r1.29 src/lib/libc/stdio/vfwprintf.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.