Mail Archives: djgpp-workers/2014/01/14/17:18:18
Am 14.01.2014 11:24, schrieb Martin Str|mberg:
> According to Juan Manuel Guerrero:
>> diff -aprNU5 djgpp.orig/src/libc/compat/stdio/mktemp.c djgpp/src/libc/compat/stdio/mktemp.c
>> --- djgpp.orig/src/libc/compat/stdio/mktemp.c 2013-12-31 14:54:02 +0100
>> +++ djgpp/src/libc/compat/stdio/mktemp.c 2014-01-09 22:24:06 +0100
>> @@ -1,82 +1,99 @@
>> +/* Copyright (C) 2014 DJ Delorie, see COPYING.DJ for details */
>> /* Copyright (C) 2013 DJ Delorie, see COPYING.DJ for details */
>> /* Copyright (C) 2009 DJ Delorie, see COPYING.DJ for details */
>> /* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
>> /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
>> /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
>> #include <libc/stubs.h>
>> #include <libc/bss.h>
>> #include <libc/symlink.h>
>> +#include <fcntl.h>
>> #include <unistd.h>
>> #include <stdlib.h>
>> #include <stdio.h>
>> #include <string.h>
>> +#include <errno.h>
>>
>> static int mktemp_count = -1;
>>
>> char *
>> mktemp(char *_template)
>> {
>> - static int count = 0;
>> - char *cp, *dp;
>> - int i, len, xcount, loopcnt;
>> - char real_path[FILENAME_MAX];
>> + register int i, len, xcount;
>> + unsigned int use_lfn = _USE_LFN;
> Hrrm... Declaring variables with register in C is considered bad form
> nowadays.
>
> May I ask why you'd do so?
>
>
> Nevertheless, thanks for all your work.
>
>
Hope the compiler optimizes as good as me. ;-)
Regards,
Juan M. Guerrero
Logging in to :pserver:anonymous AT cvs DOT delorie DOT com:2401/cvs/djgpp
Index: djgpp/src/libc/compat/stdio/mktemp.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/compat/stdio/mktemp.c,v
retrieving revision 1.5
diff -p -U 5 -r1.5 mktemp.c
--- djgpp/src/libc/compat/stdio/mktemp.c 10 Jan 2014 20:16:49 -0000 1.5
+++ djgpp/src/libc/compat/stdio/mktemp.c 14 Jan 2014 21:36:25 -0000
@@ -17,11 +17,11 @@
static int mktemp_count = -1;
char *
mktemp(char *_template)
{
- register int i, len, xcount;
+ int i, len, xcount;
unsigned int use_lfn = _USE_LFN;
for (i = 0; _template[i]; i++)
;
for (xcount = 0, len = i; xcount < 6 && _template[--i] == 'X'; xcount++)
- Raw text -