Mail Archives: djgpp-workers/2001/06/09/16:30:33
> From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
> Date: Sat, 9 Jun 2001 19:11:59 +0200 (MEST)
>
> Are these correct corrections?:
>
> Index: src/libc/ansi/stdio/doprnt.c
> ===================================================================
> RCS file: /cvs/djgpp/djgpp/src/libc/ansi/stdio/doprnt.c,v
> retrieving revision 1.8
> diff -p -u -r1.8 doprnt.c
> --- src/libc/ansi/stdio/doprnt.c 1999/07/04 14:18:04 1.8
> +++ src/libc/ansi/stdio/doprnt.c 2001/06/09 17:06:39
> @@ -327,7 +327,7 @@ _doprnt(const char *fmt0, va_list argp,
> */
> char *p /*, *memchr() */;
>
> - if ((p = memchr(t, 0, prec)))
> + if ((p = memchr(t, 0, (size_t)prec)))
This is okay.
> Index: src/libc/dos/compat/d_read.c
> ===================================================================
> RCS file: /cvs/djgpp/djgpp/src/libc/dos/compat/d_read.c,v
> retrieving revision 1.1
> diff -p -u -r1.1 d_read.c
> --- src/libc/dos/compat/d_read.c 1995/10/09 06:00:00 1.1
> +++ src/libc/dos/compat/d_read.c 2001/06/09 17:06:47
> @@ -24,7 +24,7 @@ unsigned int _dos_read(int handle, void
>
> /* Allocate ~64K or less transfer buffer from DOS */
> dos_buffer_size = ( count < 0xFFE0 ) ? count : 0xFFE0;
> - if ( (dos_segment=__dpmi_allocate_dos_memory((dos_buffer_size + 15) >> 4, &dos_selector)) == -1 )
> + if ( (dos_segment=__dpmi_allocate_dos_memory((dos_buffer_size + 15) >> 4, &dos_selector)) == (unsigned int)-1 )
Here, I think it is better to declare dos_segment as signed int.
> Index: src/libc/posix/sys/stat/is_exec.c
> ===================================================================
> RCS file: /cvs/djgpp/djgpp/src/libc/posix/sys/stat/is_exec.c,v
> retrieving revision 1.3
> diff -p -u -r1.3 is_exec.c
> --- src/libc/posix/sys/stat/is_exec.c 1999/03/20 21:59:51 1.3
> +++ src/libc/posix/sys/stat/is_exec.c 2001/06/09 17:07:02
> @@ -181,7 +181,7 @@ _is_executable(const char *filename, int
> if ((_djstat_flags & _STAT_EXEC_EXT) == 0
> && extension
> && *extension
> - && strlen(extension) <= ((extension[0]=='.') ? 4 : 3))
> + && strlen(extension) <= ((extension[0]=='.') ? 4U : 3U))
This is fine.
> I ask because I'm not a master of signed and unsigned issues.
Who is? ;-)
- Raw text -