Mail Archives: djgpp-workers/2008/04/08/23:52:15
This is a multi-part message in MIME format.
--------------080604020101090001020807
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
DJ Delorie wrote:
>> One could try to build current CVS version of djdev with it. Attached 2 completely
>> untested patches to fix some strict-aliasing warning related problems.
>
> Well, one attached. The other isn't a patch. The patch one is OK though.
>
>> --------------070407090706030207040607
>> Content-Type: text/x-patch;
>> name="libc_dos_dir.diff"
>> Content-Transfer-Encoding: 7bit
>> Content-Disposition: inline;
>> filename="libc_dos_dir.diff"
>>
>> Repository : :pserver:andris AT cvs DOT delorie DOT com:/cvs/djgpp
>> Module : djgpp/src/libc/dos/dir
>> Working dir: ~/Build/rpm-root/BUILD/djgpp/src/libc/dos/dir/
>>
>>
>>
>> In directory .:
>> Up-To-Date 1.1 .cvsignore
>> Modified 1.5 findfirs.c
Sorry. Saved wrong buffer from Emacs...
Attached correct content now.
Andris
--------------080604020101090001020807
Content-Type: text/x-patch;
name="libc_dos_dir.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="libc_dos_dir.diff"
Index: findfirs.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/dos/dir/findfirs.c,v
retrieving revision 1.5
diff -u -r1.5 findfirs.c
--- findfirs.c 11 Dec 2007 07:27:39 -0000 1.5
+++ findfirs.c 9 Apr 2008 03:49:41 -0000
@@ -54,11 +54,16 @@
__dpmi_int(0x21, &r);
if(!(r.x.flags & 1)) {
struct ffblklfn ffblk32;
+ unsigned long t1;
/* Recover results */
dosmemget(__tb+pathlen, sizeof(struct ffblklfn), &ffblk32);
ffblk->ff_attrib = (char)ffblk32.fd_attrib;
- *(long *)(void *)(&ffblk->ff_ftime) = _Win32_to_DOS(ffblk32.fd_mtime);
+
+ t1 = _Win32_to_DOS(ffblk32.fd_mtime);
+ ffblk->ff_ftime = t1;
+ ffblk->ff_fdate = t1 >> 16;
+
ffblk->ff_fsize = ffblk32.fd_size;
strcpy(ffblk->ff_name, ffblk32.fd_longname);
strcpy(ffblk->lfn_magic, "LFN32");
@@ -72,8 +77,13 @@
}
ffblk->lfn_handle = r.x.ax;
- *(long *)(void *)(&ffblk->lfn_ctime) = _Win32_to_DOS(ffblk32.fd_ctime);
- *(long *)(void *)(&ffblk->lfn_atime) = _Win32_to_DOS(ffblk32.fd_atime);
+ t1 = _Win32_to_DOS(ffblk32.fd_ctime);
+ ffblk->lfn_ctime = t1;
+ ffblk->lfn_cdate = t1 >> 16;
+
+ t1 = _Win32_to_DOS(ffblk32.fd_atime);
+ ffblk->lfn_atime = t1;
+ ffblk->lfn_adate = t1 >> 16;
return 0;
}
Index: findnext.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/dos/dir/findnext.c,v
retrieving revision 1.4
diff -u -r1.4 findnext.c
--- findnext.c 11 Dec 2007 07:27:39 -0000 1.4
+++ findnext.c 9 Apr 2008 03:49:42 -0000
@@ -47,16 +47,23 @@
__dpmi_int(0x21, &r);
if (!(r.x.flags & 1))
{
+ unsigned long t1;
struct ffblklfn ffblk32;
/* Recover results */
dosmemget(__tb, sizeof(struct ffblklfn), &ffblk32);
ffblk->ff_attrib = (char)ffblk32.fd_attrib;
- *(long *)(void *)&ffblk->ff_ftime = _Win32_to_DOS(ffblk32.fd_mtime);
+ t1 = _Win32_to_DOS(ffblk32.fd_mtime);
+ ffblk->ff_ftime = t1;
+ ffblk->ff_fdate = t1 >> 16;
ffblk->ff_fsize = ffblk32.fd_size;
strcpy(ffblk->ff_name, ffblk32.fd_longname);
- *(long *)(void *)&ffblk->lfn_ctime = _Win32_to_DOS(ffblk32.fd_ctime);
- *(long *)(void *)&ffblk->lfn_atime = _Win32_to_DOS(ffblk32.fd_atime);
+ t1 = _Win32_to_DOS(ffblk32.fd_ctime);
+ ffblk->lfn_ctime = t1;
+ ffblk->lfn_cdate = t1 >> 16;
+ t1 = _Win32_to_DOS(ffblk32.fd_atime);
+ ffblk->lfn_atime = t1;
+ ffblk->lfn_adate = t1 >> 16;
return 0;
}
--------------080604020101090001020807--
- Raw text -