Skip to content

Commit 5304e65

Browse files
jmalakPerditionC
authored andcommitted
time.t: resolve issue with internal and standard C time.h files and remove all hacks
- fix issue by renaming header file and symbols which consolidate with standard C time.h - rename also date.h for consistency - remove all hacks from make files and from sys.c now can share new dtime.h with standard C time.h without any collision that any order of internal and standard C header path is possible
1 parent 4ca2825 commit 5304e65

File tree

19 files changed

+35
-35
lines changed

19 files changed

+35
-35
lines changed

filelist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@
3434
*/*/hdr/buffer.h
3535
*/*/hdr/cds.h
3636
*/*/hdr/clock.h
37-
*/*/hdr/date.h
3837
*/*/hdr/dcb.h
38+
*/*/hdr/ddate.h
3939
*/*/hdr/device.h
4040
*/*/hdr/dirmatch.h
41+
*/*/hdr/dtime.h
4142
*/*/hdr/error.h
4243
*/*/hdr/exe.h
4344
*/*/hdr/fat.h
@@ -56,7 +57,6 @@
5657
*/*/hdr/sft.h
5758
*/*/hdr/stacks.inc
5859
*/*/hdr/tail.h
59-
*/*/hdr/time.h
6060
*/*/hdr/version.h
6161
*/*/hdr/xstructs.h
6262
*/*/kernel/nls/001-437.hc

hdr/date.h renamed to hdr/ddate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static BYTE *date_hRcsId =
5151
#define EPOCH_DAY 1 /* 1 for January 1 */
5252
#define EPOCH_YEAR 1980 /* for Tues 1-1-80 epoch */
5353

54-
typedef UWORD date;
54+
typedef UWORD ddate;
5555

5656
#endif
5757

hdr/dirmatch.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ typedef struct {
4747
UWORD reserved2;
4848

4949
UBYTE dm_attr_fnd; /* found file attribute */
50-
time dm_time; /* file time */
51-
date dm_date; /* file date */
50+
dtime dm_time; /* file time */
51+
ddate dm_date; /* file date */
5252
ULONG dm_size; /* file size */
5353
BYTE dm_name[FNAME_SIZE + FEXT_SIZE + 2]; /* file name */
5454
} dmatch;

hdr/time.h renamed to hdr/dtime.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static BYTE *time_hRcsId =
3939
#endif
4040
#endif
4141

42-
typedef UWORD time;
42+
typedef UWORD dtime;
4343

4444
struct dostime
4545
{

hdr/fat.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ struct dirent {
105105
UWORD dir_crdate; /* Creation date */
106106
UWORD dir_accdate; /* Last access date */
107107
UWORD dir_start_high; /* High word of the cluster */
108-
time dir_time; /* Time file created/updated */
109-
date dir_date; /* Date file created/updated */
108+
dtime dir_time; /* Time file created/updated */
109+
ddate dir_date; /* Date file created/updated */
110110
UWORD dir_start; /* Starting cluster */
111111
/* 1st available = 2 */
112112
ULONG dir_size; /* File size in bytes */

hdr/fcb.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ typedef struct {
8686
UWORD fcb_recsiz; /* Logical record size in bytes, */
8787
/* default = 128 */
8888
ULONG fcb_fsize; /* File size in bytes */
89-
date fcb_date; /* Date file created */
90-
time fcb_time; /* Time of last write */
89+
ddate fcb_date; /* Date file created */
90+
dtime fcb_time; /* Time of last write */
9191
/* the following are reserved by system */
9292
BYTE fcb_sftno; /* Device ID */
9393
BYTE fcb_attrib_hi; /* share info, dev attrib word hi */

hdr/sft.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ typedef struct {
6161
#else
6262
CLUSTER sft_stclust; /* 0b - Starting cluster */
6363
#endif
64-
time sft_time; /* 0d - File time */
65-
date sft_date; /* 0f - File date */
64+
dtime sft_time; /* 0d - File time */
65+
ddate sft_date; /* 0f - File date */
6666
ULONG sft_size; /* 11 - File size */
6767
ULONG sft_posit; /* 15 - Current file position */
6868
UWORD sft_relclust; /* 19 - File relative cluster (low part) */

kernel/dosfns.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ COUNT DosFindNext(void)
11301130
return pop_dmp(rc, dmp);
11311131
}
11321132

1133-
COUNT DosGetFtime(COUNT hndl, date * dp, time * tp)
1133+
COUNT DosGetFtime(COUNT hndl, ddate * dp, dtime * tp)
11341134
{
11351135
sft FAR *s;
11361136
/*sfttbl FAR *sp;*/
@@ -1144,7 +1144,7 @@ COUNT DosGetFtime(COUNT hndl, date * dp, time * tp)
11441144
return SUCCESS;
11451145
}
11461146

1147-
COUNT DosSetFtimeSft(int sft_idx, date dp, time tp)
1147+
COUNT DosSetFtimeSft(int sft_idx, ddate dp, dtime tp)
11481148
{
11491149
/* Get the SFT block that contains the SFT */
11501150
sft FAR *s = idx_to_sft(sft_idx);

kernel/fatfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ COUNT map_cluster(f_node_ptr, COUNT);
5252
STATIC int shrink_file(f_node_ptr fnp);
5353

5454
/* FAT time notation in the form of hhhh hmmm mmmd dddd (d = double second) */
55-
STATIC time time_encode(struct dostime *t)
55+
STATIC dtime time_encode(struct dostime *t)
5656
{
5757
return (t->hour << 11) | (t->minute << 5) | (t->second >> 1);
5858
}
@@ -666,7 +666,7 @@ STATIC int alloc_find_free(f_node_ptr fnp, char *path)
666666
/* */
667667
/* dos_getdate for the file date */
668668
/* */
669-
date dos_getdate(void)
669+
ddate dos_getdate(void)
670670
{
671671
struct dosdate dd;
672672

@@ -679,7 +679,7 @@ date dos_getdate(void)
679679
/* */
680680
/* dos_gettime for the file time */
681681
/* */
682-
time dos_gettime(void)
682+
dtime dos_gettime(void)
683683
{
684684
struct dostime dt;
685685

kernel/globals.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ static BYTE *Globals_hRcsId =
3737
#include "device.h"
3838
#include "mcb.h"
3939
#include "pcb.h"
40-
#include "date.h"
41-
#include "time.h"
40+
#include "ddate.h"
41+
#include "dtime.h"
4242
#include "fat.h"
4343
#include "fcb.h"
4444
#include "tail.h"

0 commit comments

Comments
 (0)