Skip to content

Commit 439b2d4

Browse files
committed
Change time to harris_time to not clash with system symbol
./types.h:40:1: error: redefinition of 'time' as different kind of symbol time; ^ /usr/include/time.h:154:8: note: previous definition is here time_t time(time_t *); ^
1 parent 3d097a3 commit 439b2d4

File tree

9 files changed

+73
-73
lines changed

9 files changed

+73
-73
lines changed

date.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ void drawmoon(SDL_Surface *s, double phase)
9696
}
9797
}
9898

99-
inline time maketime(int t)
99+
inline harris_time maketime(int t)
100100
{
101-
return((time){(12+(t/120))%24, (t/2)%60});
101+
return((harris_time){(12+(t/120))%24, (t/2)%60});
102102
}
103103

104-
inline unsigned int rrtime(time t)
104+
inline unsigned int rrtime(harris_time t)
105105
{
106106
int h=t.hour-12;
107107
if(h<0) h+=24;

date.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ int diffdate(date date1, date date2); // returns <0 if date1<date2, >0 if date1>
2020
double pom(date when); // returns in [0,1); 0 for new moon, 0.5 for full moon
2121
double foldpom(double pom); // returns illumination in [0,1]
2222
void drawmoon(SDL_Surface *s, double phase); // renders moon to image
23-
time maketime(int t); // converts run_raid time to clock time
24-
unsigned int rrtime(time t); // converts clock time to run_raid time
23+
harris_time maketime(int t); // converts run_raid time to clock time
24+
unsigned int rrtime(harris_time t); // converts clock time to run_raid time
2525
date nextday(date when); // computes the date 1 day after the given one
26-
#define TM(H,M) (time){.hour=(H), .minute=(M)}
26+
#define TM(H,M) (harris_time){.hour=(H), .minute=(M)}
2727
#define RRT(H,M) rrtime(TM((H),(M)))

history.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ int hist_load(FILE *in, size_t nents, history *hist)
124124
return(0);
125125
}
126126

127-
int ev_append(history *hist, date d, time t, const char *ev)
127+
int ev_append(history *hist, date d, harris_time t, const char *ev)
128128
{
129129
char *p=hist_alloc(hist);
130130
if(!p) return(1);
@@ -136,7 +136,7 @@ int ev_append(history *hist, date d, time t, const char *ev)
136136
return(0);
137137
}
138138

139-
int eva_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type, const char *ev)
139+
int eva_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type, const char *ev)
140140
{
141141
char buf[HIST_LINE];
142142
size_t i=sprintf(buf, "A ");
@@ -148,133 +148,133 @@ int eva_append(history *hist, date d, time t, acid id, bool ftr, unsigned int ty
148148
return(ev_append(hist, d, t, buf));
149149
}
150150

151-
int ct_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type)
151+
int ct_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type)
152152
{
153153
return(eva_append(hist, d, t, id, ftr, type, "CT"));
154154
}
155155

156-
int na_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type, unsigned int nid)
156+
int na_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type, unsigned int nid)
157157
{
158158
char buf[HIST_LINE];
159159
snprintf(buf, HIST_LINE, "NA %u", nid);
160160
return(eva_append(hist, d, t, id, ftr, type, buf));
161161
}
162162

163-
int pf_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type)
163+
int pf_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type)
164164
{
165165
return(eva_append(hist, d, t, id, ftr, type, "PF"));
166166
}
167167

168-
int ra_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type, unsigned int tid)
168+
int ra_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type, unsigned int tid)
169169
{
170170
char buf[HIST_LINE];
171171
snprintf(buf, HIST_LINE, "RA %u", tid);
172172
return(eva_append(hist, d, t, id, ftr, type, buf));
173173
}
174174

175-
int hi_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type, unsigned int tid, unsigned int bmb)
175+
int hi_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type, unsigned int tid, unsigned int bmb)
176176
{
177177
char buf[HIST_LINE];
178178
snprintf(buf, HIST_LINE, "HI %u %u", tid, bmb);
179179
return(eva_append(hist, d, t, id, ftr, type, buf));
180180
}
181181

182-
int dmac_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type, double ddmg, double cdmg, acid src)
182+
int dmac_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type, double ddmg, double cdmg, acid src)
183183
{
184184
char buf[HIST_LINE];
185185
size_t i=snprintf(buf, 72, "DM %a %a AC ", ddmg, cdmg);
186186
pacid(src, buf+i);
187187
return(eva_append(hist, d, t, id, ftr, type, buf));
188188
}
189189

190-
int dmfk_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type, double ddmg, double cdmg, unsigned int fid)
190+
int dmfk_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type, double ddmg, double cdmg, unsigned int fid)
191191
{
192192
char buf[HIST_LINE];
193193
snprintf(buf, HIST_LINE, "DM %a %a FK %u", ddmg, cdmg, fid);
194194
return(eva_append(hist, d, t, id, ftr, type, buf));
195195
}
196196

197-
int dmtf_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type, double ddmg, double cdmg, unsigned int tid)
197+
int dmtf_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type, double ddmg, double cdmg, unsigned int tid)
198198
{
199199
char buf[HIST_LINE];
200200
snprintf(buf, HIST_LINE, "DM %a %a TF %u", ddmg, cdmg, tid);
201201
return(eva_append(hist, d, t, id, ftr, type, buf));
202202
}
203203

204-
int fa_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type, unsigned int fa)
204+
int fa_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type, unsigned int fa)
205205
{
206206
char buf[HIST_LINE];
207207
snprintf(buf, HIST_LINE, "FA %u", fa);
208208
return(eva_append(hist, d, t, id, ftr, type, buf));
209209
}
210210

211-
int cr_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type)
211+
int cr_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type)
212212
{
213213
return(eva_append(hist, d, t, id, ftr, type, "CR"));
214214
}
215215

216-
int ob_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type)
216+
int ob_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type)
217217
{
218218
return(eva_append(hist, d, t, id, ftr, type, "OB"));
219219
}
220220

221-
int evt_append(history *hist, date d, time t, unsigned int tid, const char *ev)
221+
int evt_append(history *hist, date d, harris_time t, unsigned int tid, const char *ev)
222222
{
223223
char buf[HIST_LINE];
224224
size_t i=snprintf(buf, HIST_LINE, "T %u ", tid);
225225
strncpy(buf+i, ev, HIST_LINE-i);
226226
return(ev_append(hist, d, t, buf));
227227
}
228228

229-
int tdm_append(history *hist, date d, time t, unsigned int tid, double ddmg, double cdmg)
229+
int tdm_append(history *hist, date d, harris_time t, unsigned int tid, double ddmg, double cdmg)
230230
{
231231
char buf[HIST_LINE];
232232
snprintf(buf, HIST_LINE, "DM %a %a", ddmg, cdmg);
233233
return(evt_append(hist, d, t, tid, buf));
234234
}
235235

236-
int tfk_append(history *hist, date d, time t, unsigned int tid, double dflk, double cflk)
236+
int tfk_append(history *hist, date d, harris_time t, unsigned int tid, double dflk, double cflk)
237237
{
238238
char buf[HIST_LINE];
239239
snprintf(buf, HIST_LINE, "FK %a %a", dflk, cflk);
240240
return(evt_append(hist, d, t, tid, buf));
241241
}
242242

243-
int tsh_append(history *hist, date d, time t, unsigned int tid)
243+
int tsh_append(history *hist, date d, harris_time t, unsigned int tid)
244244
{
245245
return(evt_append(hist, d, t, tid, "SH"));
246246
}
247247

248-
int evm_append(history *hist, date d, time t, const char *ev)
248+
int evm_append(history *hist, date d, harris_time t, const char *ev)
249249
{
250250
char buf[HIST_LINE];
251251
size_t i=sprintf(buf, "M ");
252252
strncpy(buf+i, ev, HIST_LINE-i);
253253
return(ev_append(hist, d, t, buf));
254254
}
255255

256-
int ca_append(history *hist, date d, time t, unsigned int cshr, unsigned int cash)
256+
int ca_append(history *hist, date d, harris_time t, unsigned int cshr, unsigned int cash)
257257
{
258258
char buf[HIST_LINE];
259259
snprintf(buf, HIST_LINE, "CA %u %u", cshr, cash);
260260
return(evm_append(hist, d, t, buf));
261261
}
262262

263-
int co_append(history *hist, date d, time t, double confid)
263+
int co_append(history *hist, date d, harris_time t, double confid)
264264
{
265265
char buf[HIST_LINE];
266266
snprintf(buf, HIST_LINE, "CO %a", confid);
267267
return(evm_append(hist, d, t, buf));
268268
}
269269

270-
int mo_append(history *hist, date d, time t, double morale)
270+
int mo_append(history *hist, date d, harris_time t, double morale)
271271
{
272272
char buf[HIST_LINE];
273273
snprintf(buf, HIST_LINE, "MO %a", morale);
274274
return(evm_append(hist, d, t, buf));
275275
}
276276

277-
int gp_append(history *hist, date d, time t, unsigned int iclass, double gprod, double dprod)
277+
int gp_append(history *hist, date d, harris_time t, unsigned int iclass, double gprod, double dprod)
278278
{
279279
char buf[HIST_LINE];
280280
snprintf(buf, HIST_LINE, "GP %u %a %a", iclass, gprod, dprod);

history.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@ int hist_clear(history *hist); // Empty the history (freeing all events)
1717
int hist_save(history hist, FILE *out); // Write history out to file
1818
int hist_load(FILE *in, size_t nents, history *hist); // Read history in from file. Not a mirror of hist_save, since it doesn't read nents itself (this is for reasons related to how loadgame functions)
1919

20-
int eva_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type, const char *ev); // Append an aircraft event to the history
21-
int ct_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type); // Append a CT (constructed) event to the history
22-
int na_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type, unsigned int nid); // Append a NA (navaid) event to the history
23-
int pf_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type); // Append a PF (PFF assign) event to the history
24-
int ra_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type, unsigned int tid); // Append a RA (raid targ) event to the history
25-
int hi_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type, unsigned int tid, unsigned int bmb); // Append a HI (hit targ) event to the history
26-
int dmac_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type, double ddmg, double cdmg, acid src); // Append a DM AC (damaged by aircraft) event to the history
27-
int dmfk_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type, double ddmg, double cdmg, unsigned int fid); // Append a DM FK (damaged by flak) event to the history
28-
int dmtf_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type, double ddmg, double cdmg, unsigned int tid); // Append a DM TF (damaged by target flak) event to the history
29-
int fa_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type, unsigned int fa); // Append a FA (failed) event to the history
30-
int cr_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type); // Append a CR (crashed) event to the history
31-
int ob_append(history *hist, date d, time t, acid id, bool ftr, unsigned int type); // Append an OB (obsolete) event to the history
20+
int eva_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type, const char *ev); // Append an aircraft event to the history
21+
int ct_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type); // Append a CT (constructed) event to the history
22+
int na_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type, unsigned int nid); // Append a NA (navaid) event to the history
23+
int pf_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type); // Append a PF (PFF assign) event to the history
24+
int ra_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type, unsigned int tid); // Append a RA (raid targ) event to the history
25+
int hi_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type, unsigned int tid, unsigned int bmb); // Append a HI (hit targ) event to the history
26+
int dmac_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type, double ddmg, double cdmg, acid src); // Append a DM AC (damaged by aircraft) event to the history
27+
int dmfk_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type, double ddmg, double cdmg, unsigned int fid); // Append a DM FK (damaged by flak) event to the history
28+
int dmtf_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type, double ddmg, double cdmg, unsigned int tid); // Append a DM TF (damaged by target flak) event to the history
29+
int fa_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type, unsigned int fa); // Append a FA (failed) event to the history
30+
int cr_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type); // Append a CR (crashed) event to the history
31+
int ob_append(history *hist, date d, harris_time t, acid id, bool ftr, unsigned int type); // Append an OB (obsolete) event to the history
3232

33-
int evt_append(history *hist, date d, time t, unsigned int tid, const char *ev); // Append a target event to the history
34-
int tdm_append(history *hist, date d, time t, unsigned int tid, double ddmg, double cdmg); // Append a DM (damaged or repaired) event to the history
35-
int tfk_append(history *hist, date d, time t, unsigned int tid, double dflk, double cflk); // Append a FK (flak-change) event to the history
36-
int tsh_append(history *hist, date d, time t, unsigned int tid); // Append a SH (ship sunk) event to the history
33+
int evt_append(history *hist, date d, harris_time t, unsigned int tid, const char *ev); // Append a target event to the history
34+
int tdm_append(history *hist, date d, harris_time t, unsigned int tid, double ddmg, double cdmg); // Append a DM (damaged or repaired) event to the history
35+
int tfk_append(history *hist, date d, harris_time t, unsigned int tid, double dflk, double cflk); // Append a FK (flak-change) event to the history
36+
int tsh_append(history *hist, date d, harris_time t, unsigned int tid); // Append a SH (ship sunk) event to the history
3737

38-
int evm_append(history *hist, date d, time t, const char *ev); // Append a miscellaneous event to the history
39-
int ca_append(history *hist, date d, time t, unsigned int cshr, unsigned int cash); // Append a CA (cash) event to the history
40-
int co_append(history *hist, date d, time t, double confid); // Append a CO (confid) event to the history
41-
int mo_append(history *hist, date d, time t, double morale); // Append a MO (morale) event to the history
42-
int gp_append(history *hist, date d, time t, unsigned int iclass, double gprod, double dprod); // Append a GP (GProd) event to the history
38+
int evm_append(history *hist, date d, harris_time t, const char *ev); // Append a miscellaneous event to the history
39+
int ca_append(history *hist, date d, harris_time t, unsigned int cshr, unsigned int cash); // Append a CA (cash) event to the history
40+
int co_append(history *hist, date d, harris_time t, double confid); // Append a CO (confid) event to the history
41+
int mo_append(history *hist, date d, harris_time t, double morale); // Append a MO (morale) event to the history
42+
int gp_append(history *hist, date d, harris_time t, unsigned int iclass, double gprod, double dprod); // Append a GP (GProd) event to the history

0 commit comments

Comments
 (0)