Skip to content

Commit ddd49d7

Browse files
committed
tailib: switch to uint64_t
This gets rid of tryulong64.c, a buildtime configure binary which interferes with cross-compilation, at the cost of bumping the minimum C version to C99.
1 parent 6c5bb6d commit ddd49d7

9 files changed

Lines changed: 20 additions & 58 deletions

File tree

src/Makefile

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ haswaitp.h: choose compile haswaitp.h1 haswaitp.h2 load trywaitp.c
232232
iopause.h: choose compile iopause.h1 iopause.h2 load trypoll.c
233233
./choose clr trypoll iopause.h1 iopause.h2 > iopause.h
234234

235-
iopause.o: compile iopause.c iopause.h select.h tai.h taia.h uint64.h
235+
iopause.o: compile iopause.c iopause.h select.h tai.h taia.h
236236
./compile iopause.c
237237

238238
load: conf-ld print-ld.sh warn-auto.sh
@@ -359,56 +359,55 @@ subgetopt.o: compile subgetopt.c subgetopt.h
359359

360360
sysdeps: compile direntry.h hasflock.h hasmkffo.h hassgact.h \
361361
hassgprm.h haswaitp.h iopause.h load select.h \
362-
uint64.h reboot_system.h uw_tmp.h socket.lib
362+
reboot_system.h uw_tmp.h socket.lib
363363
rm -f sysdeps
364364
cat compile load socket.lib >>sysdeps
365365
grep sysdep direntry.h >>sysdeps
366366
grep sysdep haswaitp.h >>sysdeps
367367
grep sysdep hassgact.h >>sysdeps
368368
grep sysdep hassgprm.h >>sysdeps
369369
grep sysdep select.h >>sysdeps
370-
grep sysdep uint64.h >>sysdeps
371370
grep sysdep iopause.h >>sysdeps
372371
grep sysdep hasmkffo.h >>sysdeps
373372
grep sysdep hasflock.h >>sysdeps
374373
grep sysdep reboot_system.h >>sysdeps
375374
grep sysdep uw_tmp.h >>sysdeps
376375
cat sysdeps
377376

378-
tai_now.o: compile tai.h tai_now.c uint64.h
377+
tai_now.o: compile tai.h tai_now.c
379378
./compile tai_now.c
380379

381-
tai_pack.o: compile tai.h tai_pack.c uint64.h
380+
tai_pack.o: compile tai.h tai_pack.c
382381
./compile tai_pack.c
383382

384-
tai_sub.o: compile tai.h tai_sub.c uint64.h
383+
tai_sub.o: compile tai.h tai_sub.c
385384
./compile tai_sub.c
386385

387-
tai_unpack.o: compile tai.h tai_unpack.c uint64.h
386+
tai_unpack.o: compile tai.h tai_unpack.c
388387
./compile tai_unpack.c
389388

390-
taia_add.o: compile tai.h taia.h taia_add.c uint64.h
389+
taia_add.o: compile tai.h taia.h taia_add.c
391390
./compile taia_add.c
392391

393-
taia_approx.o: compile tai.h taia.h taia_approx.c uint64.h
392+
taia_approx.o: compile tai.h taia.h taia_approx.c
394393
./compile taia_approx.c
395394

396-
taia_frac.o: compile tai.h taia.h taia_frac.c uint64.h
395+
taia_frac.o: compile tai.h taia.h taia_frac.c
397396
./compile taia_frac.c
398397

399-
taia_less.o: compile tai.h taia.h taia_less.c uint64.h
398+
taia_less.o: compile tai.h taia.h taia_less.c
400399
./compile taia_less.c
401400

402-
taia_now.o: compile tai.h taia.h taia_now.c uint64.h
401+
taia_now.o: compile tai.h taia.h taia_now.c
403402
./compile taia_now.c
404403

405-
taia_pack.o: compile tai.h taia.h taia_pack.c uint64.h
404+
taia_pack.o: compile tai.h taia.h taia_pack.c
406405
./compile taia_pack.c
407406

408-
taia_sub.o: compile tai.h taia.h taia_sub.c uint64.h
407+
taia_sub.o: compile tai.h taia.h taia_sub.c
409408
./compile taia_sub.c
410409

411-
taia_uint.o: compile tai.h taia.h taia_uint.c uint64.h
410+
taia_uint.o: compile tai.h taia.h taia_uint.c
412411
./compile taia_uint.c
413412

414413
time.a: iopause.o makelib tai_now.o tai_pack.o tai_sub.o tai_unpack.o \
@@ -418,9 +417,6 @@ taia_pack.o taia_sub.o taia_uint.o
418417
tai_unpack.o taia_add.o taia_approx.o taia_frac.o taia_less.o \
419418
taia_now.o taia_pack.o taia_sub.o taia_uint.o
420419

421-
uint64.h: choose compile load tryulong64.c uint64.h1 uint64.h2
422-
./choose clr tryulong64 uint64.h1 uint64.h2 > uint64.h
423-
424420
unix.a: alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o buffer_2.o \
425421
buffer_get.o buffer_put.o buffer_read.o buffer_write.o coe.o env.o \
426422
error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o lock_exnb.o \

src/TARGETS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ taia_pack.o
119119
taia_sub.o
120120
taia_uint.o
121121
time.a
122-
uint64.h
123122
unix.a
124123
wait_nohang.o
125124
wait_pid.o

src/runsvdir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ int main(int argc, char **argv) {
233233
dev =s.st_dev;
234234
ino =s.st_ino;
235235
check =0;
236-
if (now.sec.x <= (4611686018427387914ULL +(uint64)mtime))
236+
if (now.sec.x <= (4611686018427387914ULL +(uint64_t)mtime))
237237
sleep(1);
238238
runsvdir();
239239
while (fchdir(curdir) == -1) {

src/tai.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
#ifndef TAI_H
44
#define TAI_H
55

6-
#include "uint64.h"
6+
#include <stdint.h>
77

88
struct tai {
9-
uint64 x;
9+
uint64_t x;
1010
} ;
1111

12-
#define tai_unix(t,u) ((void) ((t)->x = 4611686018427387914ULL + (uint64) (u)))
12+
#define tai_unix(t,u) ((void) ((t)->x = 4611686018427387914ULL + (uint64_t) (u)))
1313

1414
extern void tai_now(struct tai *);
1515

src/tai_pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
void tai_pack(char *s,const struct tai *t)
66
{
7-
uint64 x;
7+
uint64_t x;
88

99
x = t->x;
1010
s[7] = x & 255; x >>= 8;

src/tai_unpack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
void tai_unpack(const char *s,struct tai *t)
66
{
7-
uint64 x;
7+
uint64_t x;
88

99
x = (unsigned char) s[0];
1010
x <<= 8; x += (unsigned char) s[1];

src/tryulong64.c

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/uint64.h1

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/uint64.h2

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)