History

get rid of trailing whitespace

Sigrid Solveig Haflínudóttir committed 10 months ago

Commit bbe19211 parent 3c1ac7030 files · +348 −348Browse files

Unified · Split

30 files
  1. c67-gen.c +40 −40
  2. coff.h +15 −15
  3. i386-asm.h +5 −5
  4. i386-gen.c +4 −4
  5. il-gen.c +7 −7
  6. il-opcodes.h +1 −1
  7. lib/bcheck.c +15 −15
  8. lib/builtin.c +2 −2
  9. lib/libtcc1.c +12 −12
  10. lib/tcov.c +5 −5
  11. stab.def +2 −2
  12. tcc-doc.texi +23 −23
  13. tcc.c +1 −1
  14. tccasm.c +22 −22
  15. tcccoff.c +2 −2
  16. tccgen.c +32 −32
  17. tcclib.h +3 −3
  18. tccmacho.c +8 −8
  19. tccpe.c +1 −1
  20. tccpp.c +19 −19
  21. tccrun.c +2 −2
  22. tests/abitest.c +15 −15
  23. tests/asmtest.S +30 −30
  24. tests/boundtest.c +2 −2
  25. tests/tcctest.c +51 −51
  26. tests/vla_test.c +2 −2
  27. texi2pod.pl +1 −1
  28. win32/tcc-win32.txt +1 −1
  29. x86_64-asm.h +1 −1
  30. x86_64-gen.c +24 −24
c67-gen.c+40−40
@@ -1,6 +1,6 @@
11 /*
22 * TMS320C67xx code generator for TCC
3− *
3+ *
44 * Copyright (c) 2001, 2002 Fabrice Bellard
55 *
66 * This library is free software; you can redistribute it and/or
@@ -152,7 +152,7 @@ ST_DATA const int reg_classes[NB_REGS] = { · 145 unmodified lines
152152 // although tcc thinks it is passing parameters on the stack,
153153 // the C67 really passes up to the first 10 params in special
154154 // regs or regs pairs (for 64 bit params). So keep track of
155−// the stack offsets so we can translate to the appropriate
155+// the stack offsets so we can translate to the appropriate
156156 // reg (pair)
157157
158158 #define NoCallArgsPassedOnStack 10
@@ -233,7 +233,7 @@ void gsym_addr(int t, int a) · 74 unmodified lines
233233 }
234234 }
235235
236−// these are regs that tcc doesn't really know about,
236+// these are regs that tcc doesn't really know about,
237237 // but assign them unique values so the mapping routines
238238 // can distinguish them
239239
@@ -285,7 +285,7 @@ int C67_map_regn(int r) · 45 unmodified lines
285285 return 0;
286286 }
287287
288−// mapping from tcc reg number to
288+// mapping from tcc reg number to
289289 // C67 register to condition code field
290290 //
291291 // valid condition code regs are:
@@ -330,15 +330,15 @@ int C67_map_regs(int r) · 38 unmodified lines
330330 else if (r >= TREG_C67_A4 && r <= TREG_C67_B13) // these form a pattern of alt pairs
331331 return (r & 2) >> 1;
332332 else if (r == C67_A0)
333− return 0; // set to A side
333+ return 0; // set to A side
334334 else if (r == C67_B2)
335− return 1; // set to B side
335+ return 1; // set to B side
336336 else if (r == C67_B3)
337337 return 1; // set to B side
338338 else if (r == C67_SP)
339− return 0x1; // set to SP (B15) B side
339+ return 0x1; // set to SP (B15) B side
340340 else if (r == C67_FP)
341− return 0x0; // set to FP (A15) A side
341+ return 0x0; // set to FP (A15) A side
342342 else
343343 ALWAYS_ASSERT(FALSE);
344344
@@ -407,7 +407,7 @@ void C67_asm(const char *s, int a, int b, int c) · 62 unmodified lines
407407 (5 << 9) | //mode 5 = pos offset, base reg + off reg
408408 (0 << 8) | //r (LDDW bit 0)
409409 (0 << 7) | //y D1/D2 A side
410− (3 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
410+ (3 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
411411 (1 << 2) | //opcode
412412 (C67_map_regs(a) << 1) | //side of src
413413 (0 << 0)); //parallel
@@ -429,7 +429,7 @@ void C67_asm(const char *s, int a, int b, int c) · 15 unmodified lines
429429 (5 << 9) | //mode 5 = pos offset, base reg + off reg
430430 (0 << 8) | //r (LDDW bit 0)
431431 (0 << 7) | //y D1/D2 A side
432− (3 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
432+ (3 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
433433 (1 << 2) | //opcode
434434 (C67_map_regs(a) << 1) | //side of src
435435 (0 << 0)); //parallel
@@ -451,7 +451,7 @@ void C67_asm(const char *s, int a, int b, int c) · 15 unmodified lines
451451 (5 << 9) | //mode 5 = pos offset, base reg + off reg
452452 (0 << 8) | //r (LDDW bit 0)
453453 (0 << 7) | //y D1/D2 A side
454− (7 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
454+ (7 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
455455 (1 << 2) | //opcode
456456 (C67_map_regs(a) << 1) | //side of src
457457 (0 << 0)); //parallel
@@ -462,7 +462,7 @@ void C67_asm(const char *s, int a, int b, int c) · 4 unmodified lines
462462 (1 << 9) | //mode 1 = pos cst offset
463463 (0 << 8) | //r (LDDW bit 0)
464464 (C67_map_regs(b) << 7) | //y D1/D2 base reg side
465− (7 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
465+ (7 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
466466 (1 << 2) | //opcode
467467 (C67_map_regs(a) << 1) | //side of src
468468 (0 << 0)); //parallel
@@ -473,7 +473,7 @@ void C67_asm(const char *s, int a, int b, int c) · 4 unmodified lines
473473 (1 << 9) | //mode 1 = pos cst offset
474474 (0 << 8) | //r (LDDW bit 0)
475475 (C67_map_regs(b) << 7) | //y D1/D2 base reg side
476− (5 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
476+ (5 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
477477 (1 << 2) | //opcode
478478 (C67_map_regs(a) << 1) | //side of src
479479 (0 << 0)); //parallel
@@ -484,7 +484,7 @@ void C67_asm(const char *s, int a, int b, int c) · 4 unmodified lines
484484 (1 << 9) | //mode 1 = pos cst offset
485485 (0 << 8) | //r (LDDW bit 0)
486486 (C67_map_regs(b) << 7) | //y D1/D2 base reg side
487− (3 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
487+ (3 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
488488 (1 << 2) | //opcode
489489 (C67_map_regs(a) << 1) | //side of src
490490 (0 << 0)); //parallel
@@ -496,7 +496,7 @@ void C67_asm(const char *s, int a, int b, int c) · 5 unmodified lines
496496 (1 << 9) | //mode 1 = pos cst offset
497497 (0 << 8) | //r (LDDW bit 0)
498498 (C67_map_regs(b) << 7) | //y D1/D2 base reg side
499− (7 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
499+ (7 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
500500 (1 << 2) | //opcode
501501 (C67_map_regs(a) << 1) | //side of src
502502 (0 << 0)); //parallel
@@ -628,7 +628,7 @@ void C67_asm(const char *s, int a, int b, int c) · 125 unmodified lines
628628 (1 << 9) | //mode 1 = pos cst offset
629629 (0 << 8) | //r (LDDW bit 0)
630630 (C67_map_regs(a) << 7) | //y D1/D2 src side
631− (2 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
631+ (2 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
632632 (1 << 2) | //opcode
633633 (C67_map_regs(b) << 1) | //side of dst
634634 (0 << 0)); //parallel
@@ -639,7 +639,7 @@ void C67_asm(const char *s, int a, int b, int c) · 4 unmodified lines
639639 (1 << 9) | //mode 1 = pos cst offset
640640 (0 << 8) | //r (LDDW bit 0)
641641 (C67_map_regs(a) << 7) | //y D1/D2 src side
642− (0 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
642+ (0 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
643643 (1 << 2) | //opcode
644644 (C67_map_regs(b) << 1) | //side of dst
645645 (0 << 0)); //parallel
@@ -661,7 +661,7 @@ void C67_asm(const char *s, int a, int b, int c) · 15 unmodified lines
661661 (1 << 9) | //mode 1 = pos cst offset
662662 (0 << 8) | //r (LDDW bit 0)
663663 (C67_map_regs(a) << 7) | //y D1/D2 src side
664− (6 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
664+ (6 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
665665 (1 << 2) | //opcode
666666 (C67_map_regs(b) << 1) | //side of dst
667667 (0 << 0)); //parallel
@@ -864,7 +864,7 @@ void C67_asm(const char *s, int a, int b, int c) · 196 unmodified lines
864864 C67_g((0 << 29) | //creg
865865 (0 << 28) | //inv
866866 (C67_map_regn(c) << 23) | //dst
867− (C67_map_regn(b) << 18) | //src2
867+ (C67_map_regn(b) << 18) | //src2
868868 (0 << 13) | //src1 NA
869869 (xpath << 12) | //x cross path if opposite sides
870870 (0x4a << 5) | //opcode
@@ -877,7 +877,7 @@ void C67_asm(const char *s, int a, int b, int c) · 6 unmodified lines
877877 C67_g((0 << 29) | //creg
878878 (0 << 28) | //inv
879879 (C67_map_regn(c) << 23) | //dst
880− (C67_map_regn(b) << 18) | //src2
880+ (C67_map_regn(b) << 18) | //src2
881881 (0 << 13) | //src1 NA
882882 (xpath << 12) | //x cross path if opposite sides
883883 (0x49 << 5) | //opcode
@@ -890,7 +890,7 @@ void C67_asm(const char *s, int a, int b, int c) · 6 unmodified lines
890890 C67_g((0 << 29) | //creg
891891 (0 << 28) | //inv
892892 (C67_map_regn(c) << 23) | //dst
893− (C67_map_regn(b) << 18) | //src2
893+ (C67_map_regn(b) << 18) | //src2
894894 (0 << 13) | //src1 NA
895895 (xpath << 12) | //x cross path if opposite sides
896896 (0x39 << 5) | //opcode
@@ -945,7 +945,7 @@ void C67_asm(const char *s, int a, int b, int c) · 48 unmodified lines
945945 (0 << 28) | //inv
946946 (C67_map_regn(c) << 23) | //dst
947947 (C67_map_regn(b) << 18) | //src2 (possible x path)
948− (C67_map_regn(a) << 13) | //src1
948+ (C67_map_regn(a) << 13) | //src1
949949 (xpath << 12) | //x cross path if opposite sides
950950 (0x3 << 5) | //opcode
951951 (0x6 << 2) | //opcode fixed
@@ -960,7 +960,7 @@ void C67_asm(const char *s, int a, int b, int c) · 8 unmodified lines
960960 (0 << 28) | //inv
961961 (C67_map_regn(c) << 23) | //dst
962962 (C67_map_regn(b) << 18) | //src2 (possible x path)
963− (C67_map_regn(a) << 13) | //src1
963+ (C67_map_regn(a) << 13) | //src1
964964 (xpath << 12) | //x cross path if opposite sides
965965 (0x7 << 5) | //opcode
966966 (0x6 << 2) | //opcode fixed
@@ -975,7 +975,7 @@ void C67_asm(const char *s, int a, int b, int c) · 8 unmodified lines
975975 (0 << 28) | //inv
976976 (C67_map_regn(c) << 23) | //dst
977977 (C67_map_regn(b) << 18) | //src2 (possible x path)
978− (C67_map_regn(a) << 13) | //src1
978+ (C67_map_regn(a) << 13) | //src1
979979 (xpath << 12) | //x cross path if opposite sides
980980 (0x7f << 5) | //opcode
981981 (0x6 << 2) | //opcode fixed
@@ -990,7 +990,7 @@ void C67_asm(const char *s, int a, int b, int c) · 8 unmodified lines
990990 (0 << 28) | //inv
991991 (C67_map_regn(c) << 23) | //dst
992992 (C67_map_regn(b) << 18) | //src2 (possible x path)
993− (C67_map_regn(a) << 13) | //src1
993+ (C67_map_regn(a) << 13) | //src1
994994 (xpath << 12) | //x cross path if opposite sides
995995 (0x7b << 5) | //opcode
996996 (0x6 << 2) | //opcode fixed
@@ -1005,7 +1005,7 @@ void C67_asm(const char *s, int a, int b, int c) · 8 unmodified lines
10051005 (0 << 28) | //inv
10061006 (C67_map_regn(c) << 23) | //dst
10071007 (C67_map_regn(b) << 18) | //src2 (possible x path)
1008− (C67_map_regn(a) << 13) | //src1
1008+ (C67_map_regn(a) << 13) | //src1
10091009 (xpath << 12) | //x cross path if opposite sides
10101010 (0x6f << 5) | //opcode
10111011 (0x6 << 2) | //opcode fixed
@@ -1020,7 +1020,7 @@ void C67_asm(const char *s, int a, int b, int c) · 8 unmodified lines
10201020 (0 << 28) | //inv
10211021 (C67_map_regn(c) << 23) | //dst
10221022 (C67_map_regn(b) << 18) | //src2 (possible x path)
1023− (C67_map_regn(a) << 13) | //src1
1023+ (C67_map_regn(a) << 13) | //src1
10241024 (xpath << 12) | //x cross path if opposite sides
10251025 (0x10 << 5) | //opcode
10261026 (0x6 << 2) | //opcode fixed
@@ -1035,7 +1035,7 @@ void C67_asm(const char *s, int a, int b, int c) · 8 unmodified lines
10351035 (0 << 28) | //inv
10361036 (C67_map_regn(c) << 23) | //dst
10371037 (C67_map_regn(b) << 18) | //src2 (possible x path)
1038− (C67_map_regn(a) << 13) | //src1
1038+ (C67_map_regn(a) << 13) | //src1
10391039 (xpath << 12) | //x cross path if opposite sides
10401040 (0x18 << 5) | //opcode
10411041 (0x6 << 2) | //opcode fixed
@@ -1050,7 +1050,7 @@ void C67_asm(const char *s, int a, int b, int c) · 8 unmodified lines
10501050 (0 << 28) | //inv
10511051 (C67_map_regn(c) << 23) | //dst
10521052 (C67_map_regn(b) << 18) | //src2 (possible x path)
1053− (C67_map_regn(a) << 13) | //src1
1053+ (C67_map_regn(a) << 13) | //src1
10541054 (xpath << 12) | //x cross path if opposite sides
10551055 (0x11 << 5) | //opcode
10561056 (0x6 << 2) | //opcode fixed
@@ -1065,7 +1065,7 @@ void C67_asm(const char *s, int a, int b, int c) · 8 unmodified lines
10651065 (0 << 28) | //inv
10661066 (C67_map_regn(c) << 23) | //dst
10671067 (C67_map_regn(b) << 18) | //src2 (possible x path)
1068− (C67_map_regn(a) << 13) | //src1
1068+ (C67_map_regn(a) << 13) | //src1
10691069 (xpath << 12) | //x cross path if opposite sides
10701070 (0x19 << 5) | //opcode
10711071 (0x6 << 2) | //opcode fixed
@@ -1080,7 +1080,7 @@ void C67_asm(const char *s, int a, int b, int c) · 8 unmodified lines
10801080 (0 << 28) | //inv
10811081 (C67_map_regn(c) << 23) | //dst
10821082 (C67_map_regn(b) << 18) | //src2 (possible x path)
1083− (C67_map_regn(a) << 13) | //src1
1083+ (C67_map_regn(a) << 13) | //src1
10841084 (xpath << 12) | //x cross path if opposite sides
10851085 (0x1c << 7) | //opcode
10861086 (0x0 << 2) | //opcode fixed
@@ -1095,7 +1095,7 @@ void C67_asm(const char *s, int a, int b, int c) · 8 unmodified lines
10951095 (0 << 28) | //inv
10961096 (C67_map_regn(c) << 23) | //dst
10971097 (C67_map_regn(b) << 18) | //src2 (possible x path)
1098− (C67_map_regn(a) << 13) | //src1
1098+ (C67_map_regn(a) << 13) | //src1
10991099 (xpath << 12) | //x cross path if opposite sides
11001100 (0x0e << 7) | //opcode
11011101 (0x0 << 2) | //opcode fixed
@@ -1125,7 +1125,7 @@ void C67_asm(const char *s, int a, int b, int c) · 23 unmodified lines
11251125 (0 << 28) | //inv
11261126 (C67_map_regn(c) << 23) | //dst
11271127 (C67_map_regn(b) << 18) | //src2
1128− (C67_map_regn(a) << 13) | //src1
1128+ (C67_map_regn(a) << 13) | //src1
11291129 (xpath << 12) | //x cross path if opposite sides
11301130 (0x37 << 6) | //opcode
11311131 (0x8 << 2) | //opcode fixed
@@ -1140,7 +1140,7 @@ void C67_asm(const char *s, int a, int b, int c) · 8 unmodified lines
11401140 (0 << 28) | //inv
11411141 (C67_map_regn(c) << 23) | //dst
11421142 (C67_map_regn(b) << 18) | //src2
1143− (C67_map_regn(a) << 13) | //src1
1143+ (C67_map_regn(a) << 13) | //src1
11441144 (xpath << 12) | //x cross path if opposite sides
11451145 (0x27 << 6) | //opcode
11461146 (0x8 << 2) | //opcode fixed
@@ -1155,7 +1155,7 @@ void C67_asm(const char *s, int a, int b, int c) · 8 unmodified lines
11551155 (0 << 28) | //inv
11561156 (C67_map_regn(c) << 23) | //dst
11571157 (C67_map_regn(b) << 18) | //src2
1158− (C67_map_regn(a) << 13) | //src1
1158+ (C67_map_regn(a) << 13) | //src1
11591159 (xpath << 12) | //x cross path if opposite sides
11601160 (0x33 << 6) | //opcode
11611161 (0x8 << 2) | //opcode fixed
@@ -1584,7 +1584,7 @@ void load(int r, SValue * sv) · 422 unmodified lines
15841584 size = 4;
15851585 }
15861586
1587− // check if fc is a positive reference on the stack,
1587+ // check if fc is a positive reference on the stack,
15881588 // if it is tcc is referencing what it thinks is a parameter
15891589 // on the stack, so check if it is really in a register.
15901590
@@ -1942,7 +1942,7 @@ void gfunc_call(int nb_args) · 351 unmodified lines
19421942 // ending with B12:B13.
19431943 //
19441944 // When a call is made, if the caller has its parameters
1945−// in regs A4-B13 these must be saved before/as the call
1945+// in regs A4-B13 these must be saved before/as the call
19461946 // parameters are loaded and restored upon return (or if/when needed).
19471947
19481948 /* generate function prolog of type 't' */
@@ -2012,7 +2012,7 @@ void gfunc_prolog(Sym *func_sym) · 63 unmodified lines
20122012
20132013 TotalBytesPushedOnStack = -loc;
20142014
2015− func_sub_sp_offset = ind; // remember where we put the stack instruction
2015+ func_sub_sp_offset = ind; // remember where we put the stack instruction
20162016 C67_ADDK(0, C67_SP); // ADDK.L2 loc,SP (just put zero temporarily)
20172017
20182018 C67_PUSH(C67_A0);
@@ -2028,11 +2028,11 @@ void gfunc_epilog(void) · 9 unmodified lines
20282028 C67_NOP(4); // NOP wait for load
20292029 C67_IREG_B_REG(0, C67_CREG_ZERO, C67_B3); // B.S2 B3
20302030 C67_POP(C67_FP);
2031− C67_ADDK(local, C67_SP); // ADDK.L2 loc,SP
2031+ C67_ADDK(local, C67_SP); // ADDK.L2 loc,SP
20322032 C67_Adjust_ADDK((int *) (cur_text_section->data +
20332033 func_sub_sp_offset),
20342034 -local + TotalBytesPushedOnStack);
2035− C67_NOP(3); // NOP
2035+ C67_NOP(3); // NOP
20362036 }
20372037 }
20382038
coff.h+15−15
@@ -31,9 +31,9 @@ struct filehdr { · 30 unmodified lines
3131 #define F_LITTLE 0x100 /* byte ordering of an AR32WR (vax) */
3232 #define F_BIG 0x200 /* byte ordering of an AR32W (3B, maxi) */
3333 #define F_PATCH 0x400 /* contains "patch" list in optional header */
34−#define F_NODF 0x400
34+#define F_NODF 0x400
3535
36−#define F_VERSION (F_GSP10 | F_GSP20)
36+#define F_VERSION (F_GSP10 | F_GSP20)
3737 #define F_BYTE_ORDER (F_LITTLE | F_BIG)
3838 #define FILHDR struct filehdr
3939
@@ -49,7 +49,7 @@ struct filehdr { · 9 unmodified lines
4949 #define ISARCHIVE(x) ((((unsigned short)(x))==(unsigned short)ARTYPE))
5050 #define BADMAGIC(x) (((unsigned short)(x) & 0x8080) && !ISMAGIC(x))
5151
52−
52+
5353 /*------------------------------------------------------------------------*/
5454 /* OPTIONAL FILE HEADER */
5555 /*------------------------------------------------------------------------*/
@@ -68,7 +68,7 @@ typedef struct aouthdr { · 12 unmodified lines
6868
6969 /*----------------------------------------------------------------------*/
7070 /* When a UNIX aout header is to be built in the optional header, */
71−/* the following magic numbers can appear in that header: */
71+/* the following magic numbers can appear in that header: */
7272 /* */
7373 /* AOUT1MAGIC : default : readonly sharable text segment */
7474 /* AOUT2MAGIC: : writable text segment */
@@ -78,7 +78,7 @@ typedef struct aouthdr { · 3 unmodified lines
7878 #define AOUT2MAGIC 0407
7979 #define PAGEMAGIC 0413
8080
81−
81+
8282 /*------------------------------------------------------------------------*/
8383 /* COMMON ARCHIVE FILE STRUCTURES */
8484 /* */
@@ -125,7 +125,7 @@ struct ar_hdr /* archive file member header - printable ascii */ · 40 unmodified lines
125125 char ar_fmag[2]; /* ARFMAG - string to end header */
126126 };
127127
128−
128+
129129 /*------------------------------------------------------------------------*/
130130 /* SECTION HEADER */
131131 /*------------------------------------------------------------------------*/
@@ -164,7 +164,7 @@ struct scnhdr { · 32 unmodified lines
164164 #define STYP_NOLOAD 0x02 /* "noload" : allocated, relocated, not loaded */
165165 #define STYP_GROUP 0x04 /* "grouped" : formed of input sections */
166166 #define STYP_PAD 0x08 /* "padding" : not allocated, not relocated, loaded */
167−#define STYP_COPY 0x10 /* "copy" : used for C init tables -
167+#define STYP_COPY 0x10 /* "copy" : used for C init tables -
168168 not allocated, relocated,
169169 loaded; reloc & lineno
170170 entries processed normally */
@@ -176,7 +176,7 @@ struct scnhdr { · 5 unmodified lines
176176 #define ALIGN_MASK 0x0F00 /* part of s_flags that is used for align vals */
177177 #define ALIGNSIZE(x) (1 << ((x & ALIGN_MASK) >> 8))
178178
179−
179+
180180 /*------------------------------------------------------------------------*/
181181 /* RELOCATION ENTRIES */
182182 /*------------------------------------------------------------------------*/
@@ -216,7 +216,7 @@ struct reloc · 33 unmodified lines
216216 #define R_PARTMS9 051 /* DSP: 9 bit page of 16 bit address */
217217 #define R_REL13 052 /* DSP: 13 bits, direct */
218218
219−
219+
220220 /*------------------------------------------------------------------------*/
221221 /* LINE NUMBER ENTRIES */
222222 /*------------------------------------------------------------------------*/
@@ -234,7 +234,7 @@ struct lineno · 11 unmodified lines
234234 #define LINENO struct lineno
235235 #define LINESZ 6 /* sizeof(LINENO) */
236236
237−
237+
238238 /*------------------------------------------------------------------------*/
239239 /* STORAGE CLASSES */
240240 /*------------------------------------------------------------------------*/
@@ -267,7 +267,7 @@ struct lineno · 26 unmodified lines
267267 #define C_ALIAS 105 /* duplicate tag */
268268 #define C_HIDDEN 106 /* special storage class for external */
269269 /* symbols in dmert public libraries */
270−
270+
271271 /*------------------------------------------------------------------------*/
272272 /* SYMBOL TABLE ENTRIES */
273273 /*------------------------------------------------------------------------*/
@@ -312,7 +312,7 @@ struct syment · 38 unmodified lines
312312 #define N_TV (unsigned short)-3 /* needs transfer vector (preload) */
313313 #define P_TV (unsigned short)-4 /* needs transfer vector (postload) */
314314
315−
315+
316316 /*------------------------------------------------------------------------*/
317317 /* The fundamental type of a symbol packed into the low */
318318 /* 4 bits of the word. */
@@ -358,11 +358,11 @@ struct syment · 39 unmodified lines
358358 #define N_BTSHFT_COFF 4
359359 #define N_TSHIFT_COFF 2
360360
361−#define BTYPE_COFF(x) ((x) & N_BTMASK_COFF)
361+#define BTYPE_COFF(x) ((x) & N_BTMASK_COFF)
362362 #define ISINT(x) (((x) >= T_CHAR && (x) <= T_LONG) || \
363363 ((x) >= T_UCHAR && (x) <= T_ULONG) || (x) == T_ENUM)
364364 #define ISFLT_COFF(x) ((x) == T_DOUBLE || (x) == T_FLOAT)
365−#define ISPTR_COFF(x) (((x) & N_TMASK_COFF) == (DT_PTR << N_BTSHFT_COFF))
365+#define ISPTR_COFF(x) (((x) & N_TMASK_COFF) == (DT_PTR << N_BTSHFT_COFF))
366366 #define ISFCN_COFF(x) (((x) & N_TMASK_COFF) == (DT_FCN << N_BTSHFT_COFF))
367367 #define ISARY_COFF(x) (((x) & N_TMASK_COFF) == (DT_ARY << N_BTSHFT_COFF))
368368 #define ISTAG_COFF(x) ((x)==C_STRTAG || (x)==C_UNTAG || (x)==C_ENTAG)
@@ -370,7 +370,7 @@ struct syment · 1 unmodified line
370370 #define INCREF_COFF(x) ((((x)&~N_BTMASK_COFF)<<N_TSHIFT_COFF)|(DT_PTR<<N_BTSHFT_COFF)|(x&N_BTMASK_COFF))
371371 #define DECREF_COFF(x) ((((x)>>N_TSHIFT_COFF)&~N_BTMASK_COFF)|((x)&N_BTMASK_COFF))
372372
373−
373+
374374 /*------------------------------------------------------------------------*/
375375 /* AUXILIARY SYMBOL ENTRY */
376376 /*------------------------------------------------------------------------*/
i386-asm.h+5−5
@@ -60,7 +60,7 @@ ALT(DEF_ASM_OP0L(stosb, 0xaa, 0, OPC_BWLX)) · 59 unmodified lines
6060 ALT(DEF_ASM_OP0L(sstob, 0xaa, 0, OPC_BWLX))
6161
6262 /* bits */
63−
63+
6464 ALT(DEF_ASM_OP2(bsfw, 0x0fbc, 0, OPC_MODRM | OPC_WLX, OPT_REGW | OPT_EA, OPT_REGW))
6565 ALT(DEF_ASM_OP2(bsrw, 0x0fbd, 0, OPC_MODRM | OPC_WLX, OPT_REGW | OPT_EA, OPT_REGW))
6666
@@ -94,7 +94,7 @@ ALT(DEF_ASM_OP2(lzcntw, 0xf30fbd, 0, OPC_MODRM | OPC_WLX, OPT_REGW | OPT_EA, OPT · 27 unmodified lines
9494 DEF_ASM_OP0(repz, 0xf3)
9595 DEF_ASM_OP0(repne, 0xf2)
9696 DEF_ASM_OP0(repnz, 0xf2)
97−
97+
9898 DEF_ASM_OP0(invd, 0x0f08)
9999 DEF_ASM_OP0(wbinvd, 0x0f09)
100100 DEF_ASM_OP0(cpuid, 0x0fa2)
@@ -236,7 +236,7 @@ ALT(DEF_ASM_OP1(jo, 0x70, 0, OPC_TEST, OPT_DISP8)) · 135 unmodified lines
236236 DEF_ASM_OP1(loopz, 0xe1, 0, 0, OPT_DISP8)
237237 DEF_ASM_OP1(loop, 0xe2, 0, 0, OPT_DISP8)
238238 DEF_ASM_OP1(jecxz, 0xe3, 0, 0, OPT_DISP8)
239−
239+
240240 /* float */
241241 /* specific fcomp handling */
242242 ALT(DEF_ASM_OP0L(fcomp, 0xd8d9, 0, 0))
@@ -298,7 +298,7 @@ ALT(DEF_ASM_OP1(fldl, 0xdd, 0, OPC_MODRM, OPT_EA)) · 55 unmodified lines
298298 DEF_ASM_OP1(fildll, 0xdf, 5, OPC_MODRM,OPT_EA)
299299 DEF_ASM_OP1(fldt, 0xdb, 5, OPC_MODRM, OPT_EA)
300300 DEF_ASM_OP1(fbld, 0xdf, 4, OPC_MODRM, OPT_EA)
301−
301+
302302 /* fp store */
303303 DEF_ASM_OP1(fst, 0xddd0, 0, OPC_REG, OPT_ST)
304304 DEF_ASM_OP1(fstl, 0xddd0, 0, OPC_REG, OPT_ST)
@@ -375,7 +375,7 @@ ALT(DEF_ASM_OP2(cmpxchgb, 0x0fb0, 0, OPC_MODRM | OPC_BWLX, OPT_REG, OPT_REG | OP · 70 unmodified lines
375375
376376 /* pentium */
377377 DEF_ASM_OP1(cmpxchg8b, 0x0fc7, 1, OPC_MODRM, OPT_EA )
378−
378+
379379 /* pentium pro */
380380 ALT(DEF_ASM_OP2(cmovo, 0x0f40, 0, OPC_MODRM | OPC_TEST | OPC_WLX, OPT_REGW | OPT_EA, OPT_REGW))
381381 DEF_ASM_OP2(fcmovb, 0xdac0, 0, OPC_REG, OPT_ST, OPT_ST0 )
i386-gen.c+4−4
@@ -1,6 +1,6 @@
11 /*
22 * X86 code generator for TCC
3− *
3+ *
44 * Copyright (c) 2001-2004 Fabrice Bellard
55 *
66 * This library is free software; you can redistribute it and/or
@@ -857,7 +857,7 @@ ST_FUNC void gen_opi(int op) · 850 unmodified lines
857857 r = vtop[-1].r;
858858 fr = vtop[0].r;
859859 o((opc << 3) | 0x01);
860− o(0xc0 + r + fr * 8);
860+ o(0xc0 + r + fr * 8);
861861 }
862862 vtop--;
863863 if (op >= TOK_ULT && op <= TOK_GT)
@@ -1032,7 +1032,7 @@ ST_FUNC void gen_opf(int op) · 168 unmodified lines
10321032 load(TREG_ST0, vtop);
10331033 swapped = !swapped;
10341034 }
1035−
1035+
10361036 switch(op) {
10371037 default:
10381038 case '+':
@@ -1092,7 +1092,7 @@ ST_FUNC void gen_cvt_itof(int t) · 53 unmodified lines
10921092 o(0x242cdf); /* fildll (%esp) */
10931093 o(0x08c483); /* add $8, %esp */
10941094 vtop->r2 = VT_CONST;
1095− } else if ((vtop->type.t & (VT_BTYPE | VT_UNSIGNED)) ==
1095+ } else if ((vtop->type.t & (VT_BTYPE | VT_UNSIGNED)) ==
10961096 (VT_INT | VT_UNSIGNED)) {
10971097 /* unsigned int to float/double/long double */
10981098 o(0x6a); /* push $0 */
il-gen.c+7−7
@@ -1,6 +1,6 @@
11 /*
22 * CIL code generator for TCC
3− *
3+ *
44 * Copyright (c) 2002 Fabrice Bellard
55 *
66 * This library is free software; you can redistribute it and/or
@@ -114,7 +114,7 @@ static void init_outfile(void) · 107 unmodified lines
114114 {
115115 if (!il_outfile) {
116116 il_outfile = stdout;
117− fprintf(il_outfile,
117+ fprintf(il_outfile,
118118 ".assembly extern mscorlib\n"
119119 "{\n"
120120 ".ver 1:0:2411:0\n"
@@ -151,7 +151,7 @@ static void out_opi(int op, int c) · 30 unmodified lines
151151 }
152152
153153 /* XXX: not complete */
154−static void il_type_to_str(char *buf, int buf_size,
154+static void il_type_to_str(char *buf, int buf_size,
155155 int t, const char *varstr)
156156 {
157157 int bt;
@@ -303,12 +303,12 @@ void load(int r, SValue *sv) · 145 unmodified lines
303303 out_op(IL_OP_LDIND_U2);
304304 else
305305 out_op(IL_OP_LDIND_I4);
306− }
306+ }
307307 } else {
308308 if (v == VT_CONST) {
309309 /* XXX: handle globals */
310310 if (fc >= -1 && fc <= 8) {
311− out_op(IL_OP_LDC_I4_M1 + fc + 1);
311+ out_op(IL_OP_LDC_I4_M1 + fc + 1);
312312 } else {
313313 out_opi(IL_OP_LDC_I4, fc);
314314 }
@@ -432,10 +432,10 @@ void gfunc_prolog(int t) · 117 unmodified lines
432432 /* XXX: cannot do better now */
433433 fprintf(il_outfile, " .maxstack %d\n", NB_REGS);
434434 fprintf(il_outfile, " .locals (int32, int32, int32, int32, int32, int32, int32, int32)\n");
435−
435+
436436 if (!strcmp(funcname, "main"))
437437 fprintf(il_outfile, " .entrypoint\n");
438−
438+
439439 sym = sym_find((unsigned)t >> VT_STRUCT_SHIFT);
440440 func_call = sym->r;
441441
il-opcodes.h+1−1
@@ -1,6 +1,6 @@
11 /*
22 * CIL opcode definition
3− *
3+ *
44 * Copyright (c) 2002 Fabrice Bellard
55 *
66 * This program is free software; you can redistribute it and/or modify
lib/bcheck.c+15−15
@@ -1,6 +1,6 @@
11 /*
22 * Tiny C Memory and bounds checker
3− *
3+ *
44 * Copyright (c) 2002 Fabrice Bellard
55 *
66 * This library is free software; you can redistribute it and/or
@@ -51,7 +51,7 @@ · 44 unmodified lines
5151
5252 #ifdef __attribute__
5353 /* an __attribute__ macro is defined in the system headers */
54− #undef __attribute__
54+ #undef __attribute__
5555 #endif
5656 #define FASTCALL __attribute__((regparm(3)))
5757
@@ -391,11 +391,11 @@ static pthread_key_t no_checking_key; · 333 unmodified lines
391391 #elif HAVE_TLS_VAR
392392 static __thread int no_checking = 0;
393393 #define NO_CHECKING_GET() no_checking
394−#define NO_CHECKING_SET(v) no_checking = v
394+#define NO_CHECKING_SET(v) no_checking = v
395395 #else
396396 static _Atomic int no_checking = 0;
397397 #define NO_CHECKING_GET() no_checking
398−#define NO_CHECKING_SET(v) no_checking = v
398+#define NO_CHECKING_SET(v) no_checking = v
399399 #endif
400400 static char exec[100];
401401
@@ -632,7 +632,7 @@ BOUND_PTR_INDIR(16) · 230 unmodified lines
632632 }
633633
634634 /* called when entering a function to add all the local regions */
635−void FASTCALL __bound_local_new(void *p1)
635+void FASTCALL __bound_local_new(void *p1)
636636 {
637637 size_t addr, fp, *p = p1;
638638
@@ -662,7 +662,7 @@ void FASTCALL __bound_local_new(void *p1) · 23 unmodified lines
662662 }
663663
664664 /* called when leaving a function to delete all the local regions */
665−void FASTCALL __bound_local_delete(void *p1)
665+void FASTCALL __bound_local_delete(void *p1)
666666 {
667667 size_t addr, fp, *p = p1;
668668
@@ -1035,7 +1035,7 @@ void __bound_init(size_t *p, int mode) · 366 unmodified lines
10351035 strcat (exec, ":");
10361036 fclose (fp);
10371037 }
1038− /* check if dlopen is used (is threre a better way?) */
1038+ /* check if dlopen is used (is threre a better way?) */
10391039 found = 0;
10401040 fp = fopen ("/proc/self/maps", "r");
10411041 if (fp) {
@@ -1305,7 +1305,7 @@ static void *bound_thread_create(void *bdata) · 263 unmodified lines
13051305 void *retval;
13061306 #if HAVE_TLS_FUNC
13071307 int *p = (int *) BOUND_MALLOC(sizeof(int));
1308−
1308+
13091309 if (!p) bound_alloc_error("bound_thread_create malloc");
13101310 *p = 0;
13111311 pthread_setspecific(no_checking_key, p);
@@ -1327,7 +1327,7 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr, · 15 unmodified lines
13271327 bound_thread_create_type *data;
13281328 sigset_t mask;
13291329 sigset_t old_mask;
1330−
1330+
13311331 use_sem = 1;
13321332 dprintf (stderr, "%s, %s()\n", __FILE__, __FUNCTION__);
13331333 sigfillset(&mask);
@@ -1465,7 +1465,7 @@ void *__bound_malloc(size_t size, const void *caller) · 131 unmodified lines
14651465 #endif
14661466 {
14671467 void *ptr;
1468−
1468+
14691469 #if MALLOC_REDIR
14701470 /* This will catch the first dlsym call from __bound_init */
14711471 if (malloc_redir == NULL) {
@@ -1487,7 +1487,7 @@ void *__bound_malloc(size_t size, const void *caller) · 15 unmodified lines
14871487 ptr = BOUND_MALLOC (size + 1);
14881488 dprintf(stderr, "%s, %s(): %p, 0x%lx\n",
14891489 __FILE__, __FUNCTION__, ptr, (unsigned long)size);
1490−
1490+
14911491 if (inited && NO_CHECKING_GET() == 0) {
14921492 WAIT_SEM ();
14931493 INCR_COUNT(bound_malloc_count);
@@ -2074,12 +2074,12 @@ static Tree * splay (size_t addr, Tree *t) · 580 unmodified lines
20742074 {
20752075 Tree N, *l, *r, *y;
20762076 int comp;
2077−
2077+
20782078 INCR_COUNT_SPLAY(bound_splay);
20792079 if (t == NULL) return t;
20802080 N.left = N.right = NULL;
20812081 l = r = &N;
2082−
2082+
20832083 for (;;) {
20842084 comp = compare(addr, t->start, t->size);
20852085 if (comp < 0) {
@@ -2127,12 +2127,12 @@ static Tree * splay_end (size_t addr, Tree *t) · 41 unmodified lines
21272127 {
21282128 Tree N, *l, *r, *y;
21292129 int comp;
2130−
2130+
21312131 INCR_COUNT_SPLAY(bound_splay_end);
21322132 if (t == NULL) return t;
21332133 N.left = N.right = NULL;
21342134 l = r = &N;
2135−
2135+
21362136 for (;;) {
21372137 comp = compare_end(addr, t->start + t->size);
21382138 if (comp < 0) {
lib/builtin.c+2−2
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 */
2020
2121 static const unsigned char table_1_32[] = {
22− 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8,
22+ 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8,
2323 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9
2424 };
2525 static const unsigned char table_2_32[32] = {
@@ -66,7 +66,7 @@ static const unsigned char table_2_64[] = { · 40 unmodified lines
6666 x = x - ((x >> 1) & 0x55555555); \
6767 x = (x & 0x33333333) + ((x >> 2) & 0x33333333); \
6868 x = (x + (x >> 4)) & 0xf0f0f0f; \
69− return ((x * 0x01010101) >> 24) & m;
69+ return ((x * 0x01010101) >> 24) & m;
7070 #define POPCOUNTL(x, m) \
7171 x = x - ((x >> 1) & 0x5555555555555555ull); \
7272 x = (x & 0x3333333333333333ull) + ((x >> 2) & 0x3333333333333333ull); \
lib/libtcc1.c+12−12
@@ -1,5 +1,5 @@
1−/* TCC runtime library.
2− Parts of this code are (c) 2002 Fabrice Bellard
1+/* TCC runtime library.
2+ Parts of this code are (c) 2002 Fabrice Bellard
33
44 Copyright (C) 1987, 1988, 1992, 1994, 1995 Free Software Foundation, Inc.
55
@@ -25,7 +25,7 @@ General Public License for more details. · 19 unmodified lines
2525 You should have received a copy of the GNU General Public License
2626 along with this program; see the file COPYING. If not, write to
2727 the Free Software Foundation, 59 Temple Place - Suite 330,
28−Boston, MA 02111-1307, USA.
28+Boston, MA 02111-1307, USA.
2929 */
3030
3131 #define W_TYPE_SIZE 32
@@ -364,10 +364,10 @@ long long __divdi3(long long u, long long v) · 332 unmodified lines
364364 int c = 0;
365365 DWunion uu, vv;
366366 DWtype w;
367−
367+
368368 uu.ll = u;
369369 vv.ll = v;
370−
370+
371371 if (uu.s.high < 0) {
372372 c = ~c;
373373 uu.ll = __negdi2 (uu.ll);
@@ -387,17 +387,17 @@ long long __moddi3(long long u, long long v) · 13 unmodified lines
387387 int c = 0;
388388 DWunion uu, vv;
389389 DWtype w;
390−
390+
391391 uu.ll = u;
392392 vv.ll = v;
393−
393+
394394 if (uu.s.high < 0) {
395395 c = ~c;
396396 uu.ll = __negdi2 (uu.ll);
397397 }
398398 if (vv.s.high < 0)
399399 vv.ll = __negdi2 (vv.ll);
400−
400+
401401 __udivmoddi4 (uu.ll, vv.ll, (UDWtype *) &w);
402402 if (c)
403403 w = __negdi2 (w);
@@ -412,7 +412,7 @@ unsigned long long __udivdi3(unsigned long long u, unsigned long long v) · 8 unmodified lines
412412 unsigned long long __umoddi3(unsigned long long u, unsigned long long v)
413413 {
414414 UDWtype w;
415−
415+
416416 __udivmoddi4 (u, v, &w);
417417 return w;
418418 }
@@ -479,7 +479,7 @@ long long __ashldi3(long long a, int b) · 60 unmodified lines
479479 /* XXX: fix tcc's code generator to do this instead */
480480 float __floatundisf(unsigned long long a)
481481 {
482− DWunion uu;
482+ DWunion uu;
483483 XFtype r;
484484
485485 uu.ll = a;
@@ -494,7 +494,7 @@ float __floatundisf(unsigned long long a) · 8 unmodified lines
494494
495495 double __floatundidf(unsigned long long a)
496496 {
497− DWunion uu;
497+ DWunion uu;
498498 XFtype r;
499499
500500 uu.ll = a;
@@ -509,7 +509,7 @@ double __floatundidf(unsigned long long a) · 8 unmodified lines
509509
510510 long double __floatundixf(unsigned long long a)
511511 {
512− DWunion uu;
512+ DWunion uu;
513513 XFtype r;
514514
515515 uu.ll = a;
lib/tcov.c+5−5
@@ -61,7 +61,7 @@ static FILE *open_tcov_file (char *cov_filename) · 60 unmodified lines
6161 fd = open (cov_filename, O_RDWR | O_CREAT, 0666);
6262 if (fd < 0)
6363 return NULL;
64−
64+
6565 #ifndef _WIN32
6666 while (fcntl (fd, F_SETLKW, &lock) && errno == EINTR)
6767 continue;
@@ -221,13 +221,13 @@ static void merge_test_coverage (tcov_file *file, FILE *fp, · 153 unmodified lines
221221 unsigned int runs;
222222 char *p;
223223 char str[10000];
224−
224+
225225 *pruns = 1;
226226 if (fp == NULL)
227227 return;
228228 if (fgets(str, sizeof(str), fp) &&
229229 (p = strrchr (str, ':')) &&
230− (sscanf (p + 1, "%u", &runs) == 1))
230+ (sscanf (p + 1, "%u", &runs) == 1))
231231 *pruns = runs + 1;
232232 while (file) {
233233 int i;
@@ -339,7 +339,7 @@ void __store_test_coverage (unsigned char * p) · 105 unmodified lines
339339 nfile->filename, funcs, 100.0 * (double) blocks_run / blocks);
340340 for (i = 0; i < nfile->n_func; i++) {
341341 func = &nfile->func[i];
342−
342+
343343 while (curline < func->first_line &&
344344 fgets(str, sizeof(str), src))
345345 fprintf (fp, " -:%5u:%s", curline++, str);
@@ -399,7 +399,7 @@ void __store_test_coverage (unsigned char * p) · 53 unmodified lines
399399 fprintf (fp, " #####:%5u:%s",
400400 curline, str);
401401 else if (has_zero)
402− fprintf (fp, "%8llu*:%5u:%s",
402+ fprintf (fp, "%8llu*:%5u:%s",
403403 count, curline, str);
404404 else
405405 fprintf (fp, "%9llu:%5u:%s",
stab.def+2−2
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 Boston, MA 02111-1307, USA. */
1919
2020 /* This contains contribution from Cygnus Support. */
21−
21+
2222 /* Global variable. Only the name is significant.
2323 To find the address, look in the corresponding external symbol. */
2424 __define_stab (N_GSYM, 0x20, "GSYM")
@@ -178,7 +178,7 @@ __define_stab (N_NBLCS, 0xF8, "NBLCS") · 153 unmodified lines
178178 /* Second symbol entry containing a length-value for the preceding entry.
179179 The value is the length. */
180180 __define_stab (N_LENG, 0xfe, "LENG")
181−
181+
182182 /* The above information, in matrix format.
183183
184184 STAB MATRIX
tcc-doc.texi+23−23
@@ -99,9 +99,9 @@ the @code{main()} of a.c. · 98 unmodified lines
9999
100100 @item @samp{tcc a.c -run b.c arg1}
101101 Compile @file{a.c} and @file{b.c}, link them together and execute them. arg1 is given
102−as first argument to the @code{main()} of the resulting program.
103−@ignore
104−Because multiple C files are specified, @option{--} are necessary to clearly
102+as first argument to the @code{main()} of the resulting program.
103+@ignore
104+Because multiple C files are specified, @option{--} are necessary to clearly
105105 separate the program arguments from the TCC options.
106106 @end ignore
107107
@@ -136,14 +136,14 @@ need to add @code{#!/usr/local/bin/tcc -run} at the start of your C source: · 28 unmodified lines
136136 #!/usr/local/bin/tcc -run
137137 #include <stdio.h>
138138
139−int main()
139+int main()
140140 @{
141141 printf("Hello World\n");
142142 return 0;
143143 @}
144144 @end example
145145
146−TCC can read C source code from @emph{standard input} when @option{-} is used in
146+TCC can read C source code from @emph{standard input} when @option{-} is used in
147147 place of @option{infile}. Example:
148148
149149 @example
@@ -305,7 +305,7 @@ Abort compilation if a warning is issued. Can be given an option to enable · 155 unmodified lines
305305 the specified warning and turn it into an error, for example
306306 @option{-Werror=unsupported}.
307307
308−@item -Wall
308+@item -Wall
309309 Activate some useful warnings (@option{-Wimplicit-function-declaration},
310310 @option{-Wdiscard-qualifiers}).
311311
@@ -574,7 +574,7 @@ function name. · 262 unmodified lines
574574
575575 int tab[10] = @{ 1, 2, [5] = 5, [9] = 9@};
576576 @end example
577−
577+
578578 @item Compound initializers are supported:
579579 @example
580580 int *p = (int [])@{ 1, 2, 3 @};
@@ -588,7 +588,7 @@ works for structures and strings. · 7 unmodified lines
588588 @end example
589589
590590 @noindent
591−is the same as writing
591+is the same as writing
592592 @example
593593 double d = 4771840.0;
594594 @end example
@@ -604,12 +604,12 @@ TCC implements some GNU C extensions: · 9 unmodified lines
604604
605605 @itemize
606606
607−@item array designators can be used without '=':
607+@item array designators can be used without '=':
608608 @example
609609 int a[10] = @{ [0] 1, [5] 2, 3, 4 @};
610610 @end example
611611
612−@item Structure field designators can be a label:
612+@item Structure field designators can be a label:
613613 @example
614614 struct @{ int x, y; @} st = @{ x: 1, y: 1@};
615615 @end example
@@ -681,7 +681,7 @@ Here are some examples: · 65 unmodified lines
681681 align variable @code{a} to 8 bytes and put it in section @code{.mysection}.
682682
683683 @example
684− int my_add(int a, int b) __attribute__ ((section(".mycodesection")))
684+ int my_add(int a, int b) __attribute__ ((section(".mycodesection")))
685685 @{
686686 return a + b;
687687 @}
@@ -698,17 +698,17 @@ generate function @code{my_add} in section @code{.mycodesection}. · 10 unmodified lines
698698 dprintf("one arg %d\n", 1);
699699 @end example
700700
701−@item @code{__FUNCTION__} is interpreted as C99 @code{__func__}
701+@item @code{__FUNCTION__} is interpreted as C99 @code{__func__}
702702 (so it has not exactly the same semantics as string literal GNUC
703703 where it is a string literal).
704704
705−@item The @code{__alignof__} keyword can be used as @code{sizeof}
705+@item The @code{__alignof__} keyword can be used as @code{sizeof}
706706 to get the alignment of a type or an expression.
707707
708−@item The @code{typeof(x)} returns the type of @code{x}.
708+@item The @code{typeof(x)} returns the type of @code{x}.
709709 @code{x} is an expression or a type.
710710
711−@item Computed gotos: @code{&&label} returns a pointer of type
711+@item Computed gotos: @code{&&label} returns a pointer of type
712712 @code{void *} on the goto label @code{label}. @code{goto *expr} can be
713713 used to jump on the pointer resulting from @code{expr}.
714714
@@ -742,7 +742,7 @@ TCC includes its own x86 inline assembler with a @code{gas}-like (GNU · 27 unmodified lines
742742 assembler) syntax. No intermediate files are generated. GCC 3.x named
743743 operands are supported.
744744
745−@item @code{__builtin_types_compatible_p()} and @code{__builtin_constant_p()}
745+@item @code{__builtin_types_compatible_p()} and @code{__builtin_constant_p()}
746746 are supported.
747747
748748 @item @code{#pragma pack} is supported for win32 compatibility.
@@ -805,7 +805,7 @@ same as C. · 56 unmodified lines
805805 @item +, -
806806 @end enumerate
807807
808−@item A value is either an absolute number or a label plus an offset.
808+@item A value is either an absolute number or a label plus an offset.
809809 All operators accept absolute values except '+' and '-'. '+' or '-' can be
810810 used to add an offset to a label. '-' supports two labels only if they
811811 are the same or if they are both defined and in the same section.
@@ -818,7 +818,7 @@ are the same or if they are both defined and in the same section. · 6 unmodified lines
818818
819819 @item All labels are considered as local, except undefined ones.
820820
821−@item Numeric labels can be used as local @code{gas}-like labels.
821+@item Numeric labels can be used as local @code{gas}-like labels.
822822 They can be defined several times in the same source. Use 'b'
823823 (backward) or 'f' (forward) as suffix to reference them:
824824
@@ -1075,7 +1075,7 @@ For more information about the ideas behind this method, see · 250 unmodified lines
10751075 @chapter The @code{libtcc} library
10761076
10771077 The @code{libtcc} library enables you to use TCC as a backend for
1078−dynamic code generation.
1078+dynamic code generation.
10791079
10801080 Read the @file{libtcc.h} to have an overview of the API. Read
10811081 @file{libtcc_test.c} to have a very simple example.
@@ -1115,10 +1115,10 @@ except: · 33 unmodified lines
11151115
11161116 @itemize
11171117
1118−@item For initialized arrays with unknown size, a first pass
1118+@item For initialized arrays with unknown size, a first pass
11191119 is done to count the number of elements.
11201120
1121−@item For architectures where arguments are evaluated in
1121+@item For architectures where arguments are evaluated in
11221122 reverse order, a first pass is done to reverse the argument order.
11231123
11241124 @end itemize
@@ -1330,7 +1330,7 @@ stack. · 205 unmodified lines
13301330 @item VT_CMP
13311331 indicates that the value is actually stored in the CPU flags (i.e. the
13321332 value is the consequence of a test). The value is either 0 or 1. The
1333−actual CPU flags used is indicated in @code{SValue.c.i}.
1333+actual CPU flags used is indicated in @code{SValue.c.i}.
13341334
13351335 If any code is generated which destroys the CPU flags, this value MUST be
13361336 put in a normal register.
@@ -1350,7 +1350,7 @@ taken. · 13 unmodified lines
13501350 @item VT_LVAL
13511351 is a flag indicating that the value is actually an lvalue (left value of
13521352 an assignment). It means that the value stored is actually a pointer to
1353−the wanted value.
1353+the wanted value.
13541354
13551355 Understanding the use @code{VT_LVAL} is very important if you want to
13561356 understand how TCC works.
tcc.c+1−1
@@ -1,6 +1,6 @@
11 /*
22 * TCC - Tiny C Compiler
3− *
3+ *
44 * Copyright (c) 2001-2004 Fabrice Bellard
55 *
66 * This library is free software; you can redistribute it and/or
tccasm.c+22−22
@@ -1,6 +1,6 @@
11 /*
22 * GAS like assembler for TCC
3− *
3+ *
44 * Copyright (c) 2001-2004 Fabrice Bellard
55 *
66 * This library is free software; you can redistribute it and/or
@@ -236,7 +236,7 @@ static void asm_expr_unary(TCCState *s1, ExprValue *pe) · 229 unmodified lines
236236 break;
237237 }
238238 }
239−
239+
240240 static void asm_expr_prod(TCCState *s1, ExprValue *pe)
241241 {
242242 int op;
@@ -245,7 +245,7 @@ static void asm_expr_prod(TCCState *s1, ExprValue *pe) · 2 unmodified lines
245245 asm_expr_unary(s1, pe);
246246 for(;;) {
247247 op = tok;
248− if (op != '*' && op != '/' && op != '%' &&
248+ if (op != '*' && op != '/' && op != '%' &&
249249 op != TOK_SHL && op != TOK_SAR)
250250 break;
251251 next();
@@ -256,14 +256,14 @@ static void asm_expr_prod(TCCState *s1, ExprValue *pe) · 4 unmodified lines
256256 case '*':
257257 pe->v *= e2.v;
258258 break;
259− case '/':
259+ case '/':
260260 if (e2.v == 0) {
261261 div_error:
262262 tcc_error("division by zero");
263263 }
264264 pe->v /= e2.v;
265265 break;
266− case '%':
266+ case '%':
267267 if (e2.v == 0)
268268 goto div_error;
269269 pe->v %= e2.v;
@@ -297,7 +297,7 @@ static void asm_expr_logic(TCCState *s1, ExprValue *pe) · 27 unmodified lines
297297 case '&':
298298 pe->v &= e2.v;
299299 break;
300− case '|':
300+ case '|':
301301 pe->v |= e2.v;
302302 break;
303303 default:
@@ -332,7 +332,7 @@ static inline void asm_expr_sum(TCCState *s1, ExprValue *pe) · 28 unmodified lines
332332 because we store only one symbol in the expression */
333333 if (!e2.sym) {
334334 /* OK */
335− } else if (pe->sym == e2.sym) {
335+ } else if (pe->sym == e2.sym) {
336336 /* OK */
337337 pe->sym = NULL; /* same symbols can be subtracted to NULL */
338338 } else {
@@ -734,7 +734,7 @@ static void asm_parse_directive(TCCState *s1, int global) · 395 unmodified lines
734734 case TOK_ASMDIR_weak:
735735 case TOK_ASMDIR_hidden:
736736 tok1 = tok;
737− do {
737+ do {
738738 Sym *sym;
739739 next();
740740 if (tok < TOK_IDENT)
@@ -780,7 +780,7 @@ static void asm_parse_directive(TCCState *s1, int global) · 39 unmodified lines
780780 case TOK_ASMDIR_text:
781781 case TOK_ASMDIR_data:
782782 case TOK_ASMDIR_bss:
783− {
783+ {
784784 char sname[64];
785785 tok1 = tok;
786786 n = 0;
@@ -831,7 +831,7 @@ static void asm_parse_directive(TCCState *s1, int global) · 44 unmodified lines
831831 }
832832 break;
833833 case TOK_ASMDIR_size:
834− {
834+ {
835835 Sym *sym;
836836 ElfSym *esym;
837837
@@ -853,7 +853,7 @@ static void asm_parse_directive(TCCState *s1, int global) · 15 unmodified lines
853853 }
854854 break;
855855 case TOK_ASMDIR_type:
856− {
856+ {
857857 Sym *sym;
858858 const char *newtype;
859859 int st_type;
@@ -948,7 +948,7 @@ static void asm_parse_directive(TCCState *s1, int global) · 88 unmodified lines
948948 }
949949 break;
950950 case TOK_ASMDIR_previous:
951− {
951+ {
952952 Section *sec;
953953 next();
954954 if (!last_text_section)
@@ -1171,7 +1171,7 @@ static void tcc_assemble_inline(TCCState *s1, const char *str, int len, int glob · 216 unmodified lines
11711171 /* find a constraint by its number or id (gcc 3 extended
11721172 syntax). return -1 if not found. Return in *pp in char after the
11731173 constraint */
1174−ST_FUNC int find_constraint(ASMOperand *operands, int nb_operands,
1174+ST_FUNC int find_constraint(ASMOperand *operands, int nb_operands,
11751175 const char *name, const char **pp)
11761176 {
11771177 int index;
@@ -1209,7 +1209,7 @@ ST_FUNC int find_constraint(ASMOperand *operands, int nb_operands, · 31 unmodified lines
12091209 return index;
12101210 }
12111211
1212−static void subst_asm_operands(ASMOperand *operands, int nb_operands,
1212+static void subst_asm_operands(ASMOperand *operands, int nb_operands,
12131213 CString *out_str, const char *str)
12141214 {
12151215 int c, index, modifier;
@@ -1421,12 +1421,12 @@ ST_FUNC void asm_instr(void) · 205 unmodified lines
14211421 token after the assembler parsing */
14221422 if (tok != ';')
14231423 expect("';'");
1424−
1424+
14251425 /* save all values in the memory */
14261426 save_regs(0);
14271427
14281428 /* compute constraints */
1429− asm_compute_constraints(operands, nb_operands, nb_outputs,
1429+ asm_compute_constraints(operands, nb_operands, nb_outputs,
14301430 clobber_regs, &out_reg);
14311431
14321432 /* substitute the operands in the asm string. No substitution is
@@ -1446,8 +1446,8 @@ ST_FUNC void asm_instr(void) · 13 unmodified lines
14461446 #endif
14471447
14481448 /* generate loads */
1449− asm_gen_code(operands, nb_operands, nb_outputs, 0,
1450− clobber_regs, out_reg);
1449+ asm_gen_code(operands, nb_operands, nb_outputs, 0,
1450+ clobber_regs, out_reg);
14511451
14521452 /* We don't allow switching section within inline asm to
14531453 bleed out to surrounding code. */
@@ -1464,9 +1464,9 @@ ST_FUNC void asm_instr(void) · 10 unmodified lines
14641464 next();
14651465
14661466 /* store the output values if needed */
1467− asm_gen_code(operands, nb_operands, nb_outputs, 1,
1467+ asm_gen_code(operands, nb_operands, nb_outputs, 1,
14681468 clobber_regs, out_reg);
1469−
1469+
14701470 /* free everything */
14711471 for(i=0;i<nb_operands;i++) {
14721472 vpop();
@@ -1488,7 +1488,7 @@ ST_FUNC void asm_global_instr(void) · 15 unmodified lines
14881488 token after the assembler parsing */
14891489 if (tok != ';')
14901490 expect("';'");
1491−
1491+
14921492 #ifdef ASM_DEBUG
14931493 printf("asm_global: \"%s\"\n", (char *)astr->data);
14941494 #endif
@@ -1497,7 +1497,7 @@ ST_FUNC void asm_global_instr(void) · 2 unmodified lines
14971497
14981498 /* assemble the string with tcc internal assembler */
14991499 tcc_assemble_inline(tcc_state, astr->data, astr->size - 1, 1);
1500−
1500+
15011501 cur_text_section->data_offset = ind;
15021502
15031503 /* restore the current C token */
tcccoff.c+2−2
@@ -1,6 +1,6 @@
11 /*
22 * COFF file handling for TCC
3− *
3+ *
44 * Copyright (c) 2003, 2004 TK
55 * Copyright (c) 2004 Fabrice Bellard
66 *
@@ -609,7 +609,7 @@ ST_FUNC int tcc_output_coff(TCCState *s1, FILE *f) · 602 unmodified lines
609609 // put a .ef
610610
611611 strcpy(csym._n._n_name, ".ef");
612− csym.n_value = EndAddress[k]; // physical address
612+ csym.n_value = EndAddress[k]; // physical address
613613 csym.n_scnum = CoffTextSectionNo;
614614 csym.n_type = 0;
615615 csym.n_sclass = C_FCN;
tccgen.c+32−32
@@ -1138,7 +1138,7 @@ ST_FUNC Sym *get_sym_ref(CType *type, Section *sec, unsigned long offset, unsign · 1137 unmodified lines
11381138 /* push a reference to a section offset by adding a dummy symbol */
11391139 static void vpush_ref(CType *type, Section *sec, unsigned long offset, unsigned long size)
11401140 {
1141− vpushsym(type, get_sym_ref(type, sec, offset, size));
1141+ vpushsym(type, get_sym_ref(type, sec, offset, size));
11421142 }
11431143
11441144 /* define a new external reference to a symbol 'v' of type 'u' */
@@ -1467,7 +1467,7 @@ ST_FUNC int get_reg_ex(int rc, int rc2) · 322 unmodified lines
14671467 {
14681468 int r;
14691469 SValue *p;
1470−
1470+
14711471 for(r=0;r<NB_REGS;r++) {
14721472 if (reg_classes[r] & rc2) {
14731473 int n;
@@ -1505,7 +1505,7 @@ ST_FUNC int get_reg(int rc) · 31 unmodified lines
15051505 }
15061506 notfound: ;
15071507 }
1508−
1508+
15091509 /* no register left : free the first one on the stack (VERY
15101510 IMPORTANT to start from the bottom to ensure that we don't
15111511 spill registers used in gen_opi()) */
@@ -1884,7 +1884,7 @@ ST_FUNC int gv(int rc) · 372 unmodified lines
18841884 }
18851885 r = gv(rc);
18861886 } else {
1887− if (is_float(vtop->type.t) &&
1887+ if (is_float(vtop->type.t) &&
18881888 (vtop->r & (VT_VALMASK | VT_LVAL)) == VT_CONST) {
18891889 /* CPUs usually cannot use float constants, so we store them
18901890 generically in data segment */
@@ -1900,7 +1900,7 @@ ST_FUNC int gv(int rc) · 9 unmodified lines
19001900 vtop->r |= VT_LVAL;
19011901 }
19021902 #ifdef CONFIG_TCC_BCHECK
1903− if (vtop->r & VT_MUSTBOUND)
1903+ if (vtop->r & VT_MUSTBOUND)
19041904 gbound();
19051905 #endif
19061906
@@ -2426,7 +2426,7 @@ static void gen_opic(int op) · 519 unmodified lines
24262426 vtop--;
24272427 } else {
24282428 /* if commutative ops, put c2 as constant */
2429− if (c1 && (op == '+' || op == '&' || op == '^' ||
2429+ if (c1 && (op == '+' || op == '&' || op == '^' ||
24302430 op == '|' || op == '*' || op == TOK_EQ || op == TOK_NE)) {
24312431 vswap();
24322432 c2 = c1; //c = c1, c1 = c2, c2 = c;
@@ -2585,7 +2585,7 @@ static void gen_opif(int op) · 152 unmodified lines
25852585 case '+': f1 += f2; break;
25862586 case '-': f1 -= f2; break;
25872587 case '*': f1 *= f2; break;
2588− case '/':
2588+ case '/':
25892589 if (f2 == 0.0) {
25902590 union { float f; unsigned u; } x1, x2, y;
25912591 /* If not in initializer we need to potentially generate
@@ -3057,7 +3057,7 @@ redo: · 465 unmodified lines
30573057 t2 = vtop[0].type.t;
30583058 bt1 = t1 & VT_BTYPE;
30593059 bt2 = t2 & VT_BTYPE;
3060−
3060+
30613061 if (bt1 == VT_FUNC || bt2 == VT_FUNC) {
30623062 if (bt2 == VT_FUNC) {
30633063 mk_pointer(&vtop->type);
@@ -3185,7 +3185,7 @@ op_err: · 121 unmodified lines
31853185 /* generic itof for unsigned long long case */
31863186 static void gen_cvt_itof1(int t)
31873187 {
3188− if ((vtop->type.t & (VT_BTYPE | VT_UNSIGNED)) ==
3188+ if ((vtop->type.t & (VT_BTYPE | VT_UNSIGNED)) ==
31893189 (VT_LLONG | VT_UNSIGNED)) {
31903190
31913191 if (t == VT_FLOAT)
@@ -3577,7 +3577,7 @@ ST_FUNC void mk_pointer(CType *type) · 385 unmodified lines
35773577 }
35783578
35793579 /* return true if type1 and type2 are exactly the same (including
3580− qualifiers).
3580+ qualifiers).
35813581 */
35823582 static int is_compatible_types(CType *type1, CType *type2)
35833583 {
@@ -3872,7 +3872,7 @@ ST_FUNC void inc(int post, int c) · 288 unmodified lines
38723872 vrotb(3);
38733873 }
38743874 /* add constant */
3875− vpushi(c - TOK_MID);
3875+ vpushi(c - TOK_MID);
38763876 gen_op('+');
38773877 vstore(); /* store value */
38783878 if (post)
@@ -3918,7 +3918,7 @@ static void parse_attribute(AttributeDef *ad) · 39 unmodified lines
39183918 int t, n;
39193919 char *astr;
39203920 AttributeDef ad_tmp;
3921−
3921+
39223922 redo:
39233923 if (tok != TOK_ATTRIBUTE1 && tok != TOK_ATTRIBUTE2)
39243924 return;
@@ -4000,7 +4000,7 @@ redo: · 75 unmodified lines
40004000 if (tok == '(') {
40014001 next();
40024002 n = expr_const();
4003− if (n <= 0 || (n & (n - 1)) != 0)
4003+ if (n <= 0 || (n & (n - 1)) != 0)
40044004 tcc_error("alignment must be a positive power of two");
40054005 skip(')');
40064006 } else {
@@ -4062,7 +4062,7 @@ redo: · 55 unmodified lines
40624062 case TOK_REGPARM2:
40634063 skip('(');
40644064 n = expr_const();
4065− if (n > 3)
4065+ if (n > 3)
40664066 n = 3;
40674067 else if (n < 0)
40684068 n = 0;
@@ -4120,9 +4120,9 @@ skip_param: · 51 unmodified lines
41204120 if (tok == '(') {
41214121 int parenthesis = 0;
41224122 do {
4123− if (tok == '(')
4123+ if (tok == '(')
41244124 parenthesis++;
4125− else if (tok == ')')
4125+ else if (tok == ')')
41264126 parenthesis--;
41274127 next();
41284128 } while (parenthesis && tok != -1);
@@ -4621,7 +4621,7 @@ do_decl: · 492 unmodified lines
46214621 if ((type1.t & VT_BTYPE) == VT_FUNC ||
46224622 (type1.t & VT_BTYPE) == VT_VOID ||
46234623 (type1.t & VT_STORAGE))
4624− tcc_error("invalid type for '%s'",
4624+ tcc_error("invalid type for '%s'",
46254625 get_tok_str(v, NULL));
46264626 }
46274627 if (tok == ':') {
@@ -4629,18 +4629,18 @@ do_decl: · 1 unmodified line
46294629 bit_size = expr_const();
46304630 /* XXX: handle v = 0 case for messages */
46314631 if (bit_size < 0)
4632− tcc_error("negative width in bit-field '%s'",
4632+ tcc_error("negative width in bit-field '%s'",
46334633 get_tok_str(v, NULL));
46344634 if (v && bit_size == 0)
4635− tcc_error("zero width for bit-field '%s'",
4635+ tcc_error("zero width for bit-field '%s'",
46364636 get_tok_str(v, NULL));
46374637 parse_attribute(&ad1);
46384638 }
46394639 size = type_size(&type1, &align);
46404640 if (bit_size >= 0) {
46414641 bt = type1.t & VT_BTYPE;
4642− if (bt != VT_INT &&
4643− bt != VT_BYTE &&
4642+ if (bt != VT_INT &&
4643+ bt != VT_BYTE &&
46444644 bt != VT_SHORT &&
46454645 bt != VT_BOOL &&
46464646 bt != VT_LLONG)
@@ -4718,7 +4718,7 @@ static void parse_btype_qualify(CType *type, int qualifiers) · 71 unmodified lines
47184718 }
47194719
47204720 /* return 0 if no type declaration. otherwise, return the basic type
4721− and skip it.
4721+ and skip it.
47224722 */
47234723 static int parse_btype(CType *type, AttributeDef *ad, int ignore_label)
47244724 {
@@ -5106,9 +5106,9 @@ static int post_type(CType *type, AttributeDef *ad, int storage, int td) · 381 unmodified lines
51065106 skip(')');
51075107 /* NOTE: const is ignored in returned type as it has a special
51085108 meaning in gcc / C++ */
5109− type->t &= ~VT_CONSTANT;
5109+ type->t &= ~VT_CONSTANT;
51105110 /* some ancient pre-K&R C allows a function to return an array
5111− and the array brackets to be put after the arguments, such
5111+ and the array brackets to be put after the arguments, such
51125112 that "int c()[]" means something like "int[] c()" */
51135113 if (tok == '[') {
51145114 next();
@@ -5219,7 +5219,7 @@ check: · 104 unmodified lines
52195219 if (n != -1)
52205220 vpop();
52215221 nocode_wanted = saved_nocode_wanted;
5222−
5222+
52235223 /* we push an anonymous symbol which will contain the array
52245224 element type */
52255225 s = sym_push(SYM_FIELD, type, 0, n);
@@ -5617,7 +5617,7 @@ ST_FUNC void unary(void) · 391 unmodified lines
56175617 goto push_tokc;
56185618 #endif
56195619 case TOK_CINT:
5620− case TOK_CCHAR:
5620+ case TOK_CCHAR:
56215621 t = VT_INT;
56225622 push_tokc:
56235623 type.t = t;
@@ -6165,7 +6165,7 @@ special_math_val: · 541 unmodified lines
61656165 }
61666166 break;
61676167 }
6168−
6168+
61696169 /* post operations */
61706170 while (1) {
61716171 if (tok == TOK_INC || tok == TOK_DEC) {
@@ -6173,8 +6173,8 @@ special_math_val: · 1 unmodified line
61736173 next();
61746174 } else if (tok == '.' || tok == TOK_ARROW) {
61756175 int qualifiers, cumofs;
6176− /* field */
6177− if (tok == TOK_ARROW)
6176+ /* field */
6177+ if (tok == TOK_ARROW)
61786178 indir();
61796179 qualifiers = vtop->type.t & (VT_CONSTANT | VT_VOLATILE);
61806180 test_lvalue();
@@ -6738,7 +6738,7 @@ static void expr_cond(void) · 557 unmodified lines
67386738 static void expr_eq(void)
67396739 {
67406740 int t;
6741−
6741+
67426742 expr_cond();
67436743 if ((t = tok) == '=' || TOK_ASSIGN(t)) {
67446744 test_lvalue();
@@ -8061,7 +8061,7 @@ static void decl_initializer(init_params *p, CType *type, unsigned long c, int f · 1316 unmodified lines
80618061
80628062 /* only parse strings here if correct type (otherwise: handle
80638063 them as ((w)char *) expressions */
8064− if ((tok == TOK_LSTR &&
8064+ if ((tok == TOK_LSTR &&
80658065 #ifdef TCC_TARGET_PE
80668066 (t1->t & VT_BTYPE) == VT_SHORT && (t1->t & VT_UNSIGNED)
80678067 #else
@@ -8240,7 +8240,7 @@ static void decl_initializer(init_params *p, CType *type, unsigned long c, int f · 172 unmodified lines
82408240 are parsed. If 'v' is zero, then a reference to the new object
82418241 is put in the value stack. If 'has_init' is 2, a special parsing
82428242 is done to handle string constants. */
8243−static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r,
8243+static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r,
82448244 int has_init, int v, int scope)
82458245 {
82468246 int size, align, addr;
tcclib.h+3−3
@@ -1,8 +1,8 @@
1−/* Simple libc header for TCC
2− *
1+/* Simple libc header for TCC
2+ *
33 * Add any function you want from the libc there. This file is here
44 * only for your convenience so that you do not need to put the whole
5− * glibc include files on your floppy disk
5+ * glibc include files on your floppy disk
66 */
77 #ifndef _TCCLIB_H
88 #define _TCCLIB_H
tccmacho.c+8−8
@@ -450,19 +450,19 @@ struct macho { · 449 unmodified lines
450450 Section *stub_helper, *la_symbol_ptr;
451451 struct dyld_info_command *dyldinfo;
452452 int helpsym, lasym, dyld_private, dyld_stub_binder;
453− int n_lazy_bind;
453+ int n_lazy_bind;
454454 struct s_lazy_bind {
455455 int section;
456456 int bind_offset;
457457 int la_symbol_offset;
458458 ElfW_Rel rel;
459459 } *s_lazy_bind;
460− int n_rebase;
460+ int n_rebase;
461461 struct s_rebase {
462462 int section;
463463 ElfW_Rel rel;
464464 } *s_rebase;
465− int n_bind;
465+ int n_bind;
466466 struct bind {
467467 int section;
468468 ElfW_Rel rel;
@@ -565,7 +565,7 @@ static void tcc_macho_add_destructor(TCCState *s1) · 96 unmodified lines
565565 text_section->sh_num, "__mh_execute_header");
566566 s = find_section(s1, ".fini_array");
567567 if (s->data_offset == 0)
568− return;
568+ return;
569569 init_sym = put_elf_sym(s1->symtab, text_section->data_offset, 0,
570570 ELFW(ST_INFO)(STB_LOCAL, STT_FUNC), 0,
571571 text_section->sh_num, "___GLOBAL_init_65535");
@@ -585,7 +585,7 @@ static void tcc_macho_add_destructor(TCCState *s1) · 13 unmodified lines
585585 ptr[0] = 0x48; // lea destructor(%rip),%rax
586586 ptr[1] = 0x8d;
587587 ptr[2] = 0x05;
588− put_elf_reloca(s1->symtab, text_section,
588+ put_elf_reloca(s1->symtab, text_section,
589589 text_section->data_offset - 23,
590590 R_X86_64_PC32, sym_index, -4);
591591 ptr[7] = 0x48; // mov %rax,%rdi
@@ -617,7 +617,7 @@ static void tcc_macho_add_destructor(TCCState *s1) · 25 unmodified lines
617617 int sym_index = ELFW(R_SYM)(rel->r_info);
618618
619619 ptr = section_ptr_add(text_section, 24);
620− put_elf_reloc(s1->symtab, text_section,
620+ put_elf_reloc(s1->symtab, text_section,
621621 text_section->data_offset - 24,
622622 R_AARCH64_ADR_PREL_PG_HI21, sym_index);
623623 write32le(ptr, 0x90000000); // adrp x0, destructor@page
@@ -626,7 +626,7 @@ static void tcc_macho_add_destructor(TCCState *s1) · 2 unmodified lines
626626 R_AARCH64_LDST8_ABS_LO12_NC, sym_index);
627627 write32le(ptr + 4, 0x91000000); // add x0,x0,destructor@pageoff
628628 write32le(ptr + 8, 0xd2800001); // mov x1, #0
629− put_elf_reloc(s1->symtab, text_section,
629+ put_elf_reloc(s1->symtab, text_section,
630630 text_section->data_offset - 12,
631631 R_AARCH64_ADR_PREL_PG_HI21, mh_execute_header);
632632 write32le(ptr + 12, 0x90000002); // adrp x2, mh_execute_header@page
@@ -828,7 +828,7 @@ static void check_relocs(TCCState *s1, struct macho *mo) · 195 unmodified lines
828828 write32le(jmp + 16, 0xf9400210); // ldr x16,[x16,dyld_stub_binder@pageoff]
829829 write32le(jmp + 20, 0xd61f0200); // br x16
830830 #endif
831−
831+
832832 goti = NULL;
833833 mo->nr_plt = mo->n_got = 0;
834834 for (i = 1; i < s1->nb_sections; i++) {
tccpe.c+1−1
@@ -1422,7 +1422,7 @@ static int pe_check_symbols(struct pe_info *pe) · 1421 unmodified lines
14221422 #ifdef TCC_TARGET_X86_64
14231423 write32le(p + 2, (DWORD)-4);
14241424 #endif
1425− put_elf_reloc(symtab_section, text_section,
1425+ put_elf_reloc(symtab_section, text_section,
14261426 offset + 2, R_XXX_THUNKFIX, is->iat_index);
14271427 #endif
14281428 }
tccpp.c+19−19
@@ -1,6 +1,6 @@
11 /*
22 * TCC - Tiny C Compiler
3− *
3+ *
44 * Copyright (c) 2001-2004 Fabrice Bellard
55 *
66 * This library is free software; you can redistribute it and/or
@@ -76,7 +76,7 @@ static struct TinyAlloc *tokstr_alloc; · 69 unmodified lines
7676
7777 static TokenString *macro_stack;
7878
79−static const char tcc_keywords[] =
79+static const char tcc_keywords[] =
8080 #define DEF(id, str) str "\0"
8181 #include "tcctok.h"
8282 #undef DEF
@@ -480,7 +480,7 @@ static TokenSym *tok_alloc_new(TokenSym **pts, const char *str, int len) · 397 unmodified lines
480480 TokenSym *ts, **ptable;
481481 int i;
482482
483− if (tok_ident >= SYM_FIRST_ANOM)
483+ if (tok_ident >= SYM_FIRST_ANOM)
484484 tcc_error("memory full (symbols)");
485485
486486 /* expand token table if needed */
@@ -515,7 +515,7 @@ ST_FUNC TokenSym *tok_alloc(const char *str, int len) · 28 unmodified lines
515515 TokenSym *ts, **pts;
516516 int i;
517517 unsigned int h;
518−
518+
519519 h = TOK_HASH_INIT;
520520 for(i=0;i<len;i++)
521521 h = TOK_HASH_FUNC(h, ((unsigned char *)str)[i]);
@@ -943,7 +943,7 @@ redo_start: · 421 unmodified lines
943943 file->buf_ptr = p;
944944 next_nomacro();
945945 p = file->buf_ptr;
946− if (a == 0 &&
946+ if (a == 0 &&
947947 (tok == TOK_ELSE || tok == TOK_ELIF || tok == TOK_ENDIF))
948948 goto the_end;
949949 if (tok == TOK_IF || tok == TOK_IFDEF || tok == TOK_IFNDEF)
@@ -1444,7 +1444,7 @@ static int expr_preprocess(TCCState *s1) · 494 unmodified lines
14441444 int c, t;
14451445 int t0 = tok;
14461446 TokenString *str;
1447−
1447+
14481448 str = tok_str_alloc();
14491449 pp_expr = 1;
14501450 while (1) {
@@ -1460,7 +1460,7 @@ static int expr_preprocess(TCCState *s1) · 9 unmodified lines
14601460 parse_flags &= ~PARSE_FLAG_PREPROCESS; /* no macro subst */
14611461 next();
14621462 t = tok;
1463− if (t == '(')
1463+ if (t == '(')
14641464 next();
14651465 parse_flags |= PARSE_FLAG_PREPROCESS;
14661466 if (tok < TOK_IDENT)
@@ -2079,7 +2079,7 @@ static void parse_escape_string(CString *outstr, const uint8_t *buf, int is_long · 612 unmodified lines
20792079 break;
20802080 case '\'':
20812081 case '\"':
2082− case '\\':
2082+ case '\\':
20832083 case '?':
20842084 break;
20852085 default:
@@ -2307,7 +2307,7 @@ static void parse_number(const char *p) · 221 unmodified lines
23072307 *q = '\0';
23082308 if (b == 16)
23092309 shift = 4;
2310− else
2310+ else
23112311 shift = 1;
23122312 bn_zero(bn);
23132313 q = token_buf;
@@ -2629,7 +2629,7 @@ maybe_newline: · 315 unmodified lines
26292629 case '#':
26302630 /* XXX: simplify */
26312631 PEEKC(c, p);
2632− if ((tok_flags & TOK_FLAG_BOL) &&
2632+ if ((tok_flags & TOK_FLAG_BOL) &&
26332633 (parse_flags & PARSE_FLAG_PREPROCESS)) {
26342634 tok_flags &= ~TOK_FLAG_BOL;
26352635 file->buf_ptr = p;
@@ -2653,7 +2653,7 @@ maybe_newline: · 17 unmodified lines
26532653 }
26542654 }
26552655 break;
2656−
2656+
26572657 /* dollar is allowed to start identifiers when not parsing asm */
26582658 case '$':
26592659 if (!(isidnum_table['$' - CH_EOF] & IS_ID)
@@ -2666,14 +2666,14 @@ maybe_newline: · 6 unmodified lines
26662666 case 'm': case 'n': case 'o': case 'p':
26672667 case 'q': case 'r': case 's': case 't':
26682668 case 'u': case 'v': case 'w': case 'x':
2669− case 'y': case 'z':
2669+ case 'y': case 'z':
26702670 case 'A': case 'B': case 'C': case 'D':
26712671 case 'E': case 'F': case 'G': case 'H':
2672− case 'I': case 'J': case 'K':
2672+ case 'I': case 'J': case 'K':
26732673 case 'M': case 'N': case 'O': case 'P':
26742674 case 'Q': case 'R': case 'S': case 'T':
26752675 case 'U': case 'V': case 'W': case 'X':
2676− case 'Y': case 'Z':
2676+ case 'Y': case 'Z':
26772677 case '_':
26782678 parse_ident_fast:
26792679 p1 = p;
@@ -2830,7 +2830,7 @@ maybe_newline: · 150 unmodified lines
28302830 tok = TOK_GT;
28312831 }
28322832 break;
2833−
2833+
28342834 case '&':
28352835 PEEKC(c, p);
28362836 if (c == '&') {
@@ -2843,7 +2843,7 @@ maybe_newline: · 6 unmodified lines
28432843 tok = '&';
28442844 }
28452845 break;
2846−
2846+
28472847 case '|':
28482848 PEEKC(c, p);
28492849 if (c == '|') {
@@ -2869,7 +2869,7 @@ maybe_newline: · 19 unmodified lines
28692869 tok = '+';
28702870 }
28712871 break;
2872−
2872+
28732873 case '-':
28742874 PEEKC(c, p);
28752875 if (c == '-') {
@@ -2891,7 +2891,7 @@ maybe_newline: · 15 unmodified lines
28912891 PARSE2('*', '*', '=', TOK_A_MUL)
28922892 PARSE2('%', '%', '=', TOK_A_MOD)
28932893 PARSE2('^', '^', '=', TOK_A_XOR)
2894−
2894+
28952895 /* comments or operator */
28962896 case '/':
28972897 PEEKC(c, p);
@@ -2911,7 +2911,7 @@ maybe_newline: · 13 unmodified lines
29112911 tok = '/';
29122912 }
29132913 break;
2914−
2914+
29152915 /* simple tokens */
29162916 case '@': /* only used in assembler */
29172917 #ifdef TCC_TARGET_ARM /* comment on arm asm */
tccrun.c+2−2
@@ -916,7 +916,7 @@ static addr_t rt_printline_dwarf (rt_context *rc, addr_t wanted_pc, bt_info *bi) · 915 unmodified lines
916916 : dwarf_read_8(ln, end);
917917 #endif
918918 }
919− else
919+ else
920920 dwarf_ignore_type(ln, end);
921921 }
922922 }
@@ -948,7 +948,7 @@ static addr_t rt_printline_dwarf (rt_context *rc, addr_t wanted_pc, bt_info *bi) · 25 unmodified lines
948948 if (i < FILE_TABLE_SIZE)
949949 filename_table[i].dir_entry = value;
950950 }
951− else
951+ else
952952 dwarf_ignore_type(ln, end);
953953 }
954954 }
tests/abitest.c+15−15
@@ -41,7 +41,7 @@ static int run_callback(const char *src, callback_type callback) { · 40 unmodified lines
4141 TCCState *s;
4242 int result;
4343 void *ptr;
44−
44+
4545 s = tcc_new();
4646 if (!s)
4747 return -1;
@@ -54,14 +54,14 @@ static int run_callback(const char *src, callback_type callback) { · 6 unmodified lines
5454 return -1;
5555 if (tcc_relocate(s) == -1)
5656 return -1;
57−
57+
5858 ptr = tcc_get_symbol(s, "f");
5959 if (!ptr)
6060 return -1;
6161 result = callback(ptr);
62−
62+
6363 tcc_delete(s);
64−
64+
6565 return result;
6666 }
6767
@@ -89,7 +89,7 @@ RET_PRIMITIVE_TEST(longdouble, LONG_DOUBLE, LONG_DOUBLE_LITERAL(378943892.0)) · 21 unmodified lines
8989
9090 /*
9191 * ret_2float_test:
92− *
92+ *
9393 * On x86-64, a struct with 2 floats should be packed into a single
9494 * SSE register (VT_DOUBLE is used for this purpose).
9595 */
@@ -117,7 +117,7 @@ static int ret_2float_test(void) { · 21 unmodified lines
117117
118118 /*
119119 * ret_2double_test:
120− *
120+ *
121121 * On x86-64, a struct with 2 doubles should be passed in two SSE
122122 * registers.
123123 */
@@ -281,7 +281,7 @@ static int reg_pack_test(void) { · 157 unmodified lines
281281 " reg_pack_test_type r = {a.x*5, a.y*3};\n"
282282 " return r;\n"
283283 "}\n";
284−
284+
285285 return run_callback(src, reg_pack_test_callback);
286286 }
287287
@@ -307,7 +307,7 @@ static int reg_pack_longlong_test(void) { · 19 unmodified lines
307307 " reg_pack_longlong_test_type r = {a.x*5, a.y*3};\n"
308308 " return r;\n"
309309 "}\n";
310−
310+
311311 return run_callback(src, reg_pack_longlong_test_callback);
312312 }
313313
@@ -365,13 +365,13 @@ static int sret_test(void) { · 51 unmodified lines
365365 " sret_test_type r = {x.a*35, x.b*19, x.c*21};\n"
366366 " return r;\n"
367367 "}\n";
368−
368+
369369 return run_callback(src, sret_test_callback);
370370 }
371371
372372 /*
373373 * one_member_union_test:
374− *
374+ *
375375 * In the x86-64 ABI a union should always be passed on the stack. However
376376 * it appears that a single member union is treated by GCC as its member.
377377 */
@@ -399,7 +399,7 @@ static int one_member_union_test(void) { · 21 unmodified lines
399399
400400 /*
401401 * two_member_union_test:
402− *
402+ *
403403 * In the x86-64 ABI a union should always be passed on the stack.
404404 */
405405 typedef union two_member_union_test_type_u {int x; long y;} two_member_union_test_type;
@@ -430,7 +430,7 @@ static int two_member_union_test(void) { · 24 unmodified lines
430430
431431 typedef struct many_struct_test_type_s {long long a, b, c;} many_struct_test_type;
432432 typedef many_struct_test_type (*many_struct_test_function_type) (many_struct_test_type,many_struct_test_type,many_struct_test_type,many_struct_test_type,many_struct_test_type,many_struct_test_type);
433−
433+
434434 static int many_struct_test_callback(void *ptr) {
435435 many_struct_test_function_type f = (many_struct_test_function_type)ptr;
436436 many_struct_test_type v = {1, 2, 3};
@@ -457,7 +457,7 @@ static int many_struct_test(void) { · 20 unmodified lines
457457
458458 typedef struct many_struct_test_2_type_s {int a, b;} many_struct_test_2_type;
459459 typedef many_struct_test_2_type (*many_struct_test_2_function_type) (many_struct_test_2_type,many_struct_test_2_type,many_struct_test_2_type,many_struct_test_2_type,many_struct_test_2_type,many_struct_test_2_type);
460−
460+
461461 static int many_struct_test_2_callback(void *ptr) {
462462 many_struct_test_2_function_type f = (many_struct_test_2_function_type)ptr;
463463 many_struct_test_2_type v = {1,2};
@@ -628,7 +628,7 @@ static int arg_align_test_callback(void *ptr) { · 164 unmodified lines
628628 }
629629
630630 static int arg_align_test(void) {
631− const char *src =
631+ const char *src =
632632 "long double f(long double a, int b, long double c, int d, long double e) {\n"
633633 " return a + c + e;\n"
634634 "}\n";
@@ -651,7 +651,7 @@ int main(int argc, char **argv) { · 16 unmodified lines
651651 int i;
652652 const char *testname = NULL;
653653 int retval = EXIT_SUCCESS;
654−
654+
655655 /* if tcclib.h and libtcc1.a are not installed, where can we find them */
656656 for (i = 1; i < argc; ++i) {
657657 if (!memcmp(argv[i], "run_test=", 9))
tests/asmtest.S+30−30
@@ -43,7 +43,7 @@ mov 0x10000, %eax · 42 unmodified lines
4343 mov 0x10000, %ax
4444 mov 0x10000, %al
4545 mov %al, 0x10000
46−
46+
4747 mov $1, %edx
4848 mov $1, %dx
4949 mov $1, %cl
@@ -67,7 +67,7 @@ movl $0x11334455,(%rbx) · 17 unmodified lines
6767 #endif
6868
6969 mov %eax, 0x12(,%edx,2)
70−
70+
7171 #ifdef __i386__
7272 mov %cr3, %edx
7373 mov %ecx, %cr3
@@ -110,10 +110,10 @@ notl %r15d · 36 unmodified lines
110110 movzbl 0x1000, %eax
111111 movzbw 0x1000, %ax
112112 movzwl 0x1000, %eax
113−
113+
114114 movzb 0x1000, %eax
115115 movzb 0x1000, %ax
116−
116+
117117 mov $0x12345678,%eax
118118
119119 #ifdef __x86_64__
@@ -130,7 +130,7 @@ notl %r15d · 10 unmodified lines
130130 mov $0x123456789abcdef0,%rcx
131131 mov $0x123456789abcdef0,%r11
132132 #endif
133−
133+
134134 #ifdef __i386__
135135 pushl %eax
136136 push %eax
@@ -145,7 +145,7 @@ notl %r15d · 8 unmodified lines
145145 push $100
146146 push 0x42(%eax)
147147 pop 0x43(%esi)
148−
148+
149149 #ifdef __i386__
150150 popl %eax
151151 pop %eax
@@ -156,31 +156,31 @@ notl %r15d · 4 unmodified lines
156156 #endif
157157 popw %ax
158158 pop %fs
159−
159+
160160 xchg %eax, %ecx
161161 xchg %edx, %eax
162162 xchg %bx, 0x10000
163163 xchg 0x10000, %ebx
164164 xchg 0x10000, %dl
165165
166− in $100, %al
167− in $100, %ax
166+ in $100, %al
167+ in $100, %ax
168168 in $100, %eax
169169 in %dx, %al
170− in %dx, %ax
170+ in %dx, %ax
171171 in %dx, %eax
172172 inb %dx
173− inw %dx
173+ inw %dx
174174 inl %dx
175175
176− out %al, $100
177− out %ax, $100
178− out %eax, $100
176+ out %al, $100
177+ out %ax, $100
178+ out %eax, $100
179179
180180 /* NOTE: gas is bugged here, so size must be added */
181− outb %al, %dx
182− outw %ax, %dx
183− outl %eax, %dx
181+ outb %al, %dx
182+ outw %ax, %dx
183+ outl %eax, %dx
184184
185185 leal 0x1000(%ebx), %ecx
186186 lea 0x1000(%ebx), %ecx
@@ -242,10 +242,10 @@ movb $15, %r12b · 55 unmodified lines
242242
243243 add %eax, (%ebx)
244244 add (%ebx), %eax
245−
245+
246246 or %dx, (%ebx)
247247 or (%ebx), %si
248−
248+
249249 add %cl, (%ebx)
250250 add (%ebx), %dl
251251
@@ -253,7 +253,7 @@ add (%ebx), %dl · 1 unmodified line
253253 incl 0x10000
254254 incb 0x10000
255255 dec %dx
256−
256+
257257 test $1, %al
258258 test $1, %cl
259259
@@ -285,7 +285,7 @@ add (%ebx), %dl · 25 unmodified lines
285285 imul $10, %eax
286286 imul $0x1100000, %eax
287287 imul $1, %eax
288−
288+
289289 idivw 0x1000
290290 div %ecx
291291 div %bl
@@ -381,7 +381,7 @@ L3: · 89 unmodified lines
381381 loop L3
382382 jecxz L3
383383
384−
384+
385385 seto %al
386386 setc %al
387387 setcb %al
@@ -509,7 +509,7 @@ L3: · 121 unmodified lines
509509 frstor 0x1000
510510 ffree %st(7)
511511 ffreep %st(6)
512−
512+
513513 ftst
514514 fxam
515515 fld1
@@ -675,7 +675,7 @@ int $0x10 · 159 unmodified lines
675675 repz cmpsb
676676 repne movsb
677677 repnz outsb
678−
678+
679679 invd
680680 wbinvd
681681 cpuid
@@ -721,13 +721,13 @@ int $0x10 · 39 unmodified lines
721721 movd 0x1000, %mm2
722722 movd %mm4, %ecx
723723 movd %mm5, 0x1000
724−
724+
725725 movq 0x1000, %mm2
726726 movq %mm4, 0x1000
727−
727+
728728 pand 0x1000, %mm3
729729 pand %mm4, %mm5
730−
730+
731731 psllw $1, %mm6
732732 psllw 0x1000, %mm7
733733 psllw %mm2, %mm7
@@ -827,10 +827,10 @@ int $0x10 · 93 unmodified lines
827827 str 0x1000
828828 str %ecx
829829 str %dx
830−
830+
831831 verr 0x1000
832832 verw 0x1000
833−
833+
834834 #ifdef __i386__
835835 push %ds
836836 pushw %ds
@@ -947,7 +947,7 @@ overrideme: · 110 unmodified lines
947947 movq %rdx, %xmm2
948948 movq %r13, %xmm3
949949 /* movq mem64->xmm is encoded as f30f7e by GAS, but as
950− 660f6e by tcc (which really is a movd and would need
950+ 660f6e by tcc (which really is a movd and would need
951951 a REX.W prefix to be movq). */
952952 movq (%rsi), %xmm3
953953 movq %mm1, %rdx
tests/boundtest.c+2−2
@@ -79,7 +79,7 @@ int test6(void) · 78 unmodified lines
7979 {
8080 int i, sum = 0;
8181 int *tab4;
82−
82+
8383 tab4 = malloc(20 * sizeof(int));
8484 free(tab4);
8585 for(i=0;i<21;i++) {
@@ -294,4 +294,4 @@ int main(int argc, char **argv) · 208 unmodified lines
294294 /*
295295 * without bound 0.77 s
296296 * with bounds 4.73
297− */
297+ */
tests/tcctest.c+51−51
@@ -249,7 +249,7 @@ void macro_test(void) · 248 unmodified lines
249249 glue(a <, <= 2);
250250 printf("a=%d\n", a);
251251 }
252−
252+
253253 /* macro function with argument outside the macro string */
254254 #define MF_s MF_hello
255255 #define MF_hello(msg) printf("%s\n",msg)
@@ -258,7 +258,7 @@ void macro_test(void) · 2 unmodified lines
258258
259259 MF_s("hi");
260260 MF_t("hi");
261−
261+
262262 /* test macro substitution inside args (should not eat stream) */
263263 printf("qq=%d\n", qq(qq)(2));
264264
@@ -322,7 +322,7 @@ void recursive_macro_test(void) · 57 unmodified lines
322322 printf("%d\n", ELFW(ST_INFO)(STB_WEAK, ELFW(ST_TYPE)(123)));
323323
324324 #define WRAP(x) x
325−
325+
326326 #define print_num(x) print_num(__FILE__,__LINE__,x)
327327 print_num(123);
328328 WRAP(print_num(123));
@@ -566,7 +566,7 @@ void goto_test() · 237 unmodified lines
566566 /* This needs to parse as label, not as start of decl. */
567567 typedef_and_label:
568568 s_loop:
569− if (i >= 10)
569+ if (i >= 10)
570570 goto s_end;
571571 printf("%d", i);
572572 i++;
@@ -829,10 +829,10 @@ void expr_test() · 256 unmodified lines
829829 printf("%d\n", ~12);
830830 printf("%d\n", -12);
831831 printf("%d\n", +12);
832− printf("%d %d %d %d\n",
833− isid('a'),
834− isid('g'),
835− isid('T'),
832+ printf("%d %d %d %d\n",
833+ isid('a'),
834+ isid('g'),
835+ isid('T'),
836836 isid('('));
837837 }
838838
@@ -1120,7 +1120,7 @@ void struct_test() · 281 unmodified lines
11201120 sizeof(altest6), __alignof__(altest6));
11211121 printf("altest7 sizeof=%d alignof=%d\n",
11221122 sizeof(altest7), __alignof__(altest7));
1123−
1123+
11241124 /* empty structures (GCC extension) */
11251125 #if !(defined _WIN32 && CC_NAME == CC_clang)
11261126 printf("sizeof(struct empty) = %d\n", sizeof(struct empty));
@@ -1147,17 +1147,17 @@ void char_short_test() · 20 unmodified lines
11471147
11481148 var1 = 0x01020304;
11491149 var2 = 0xfffefdfc;
1150− printf("s8=%d %d\n",
1150+ printf("s8=%d %d\n",
11511151 *(signed char *)&var1, *(signed char *)&var2);
1152− printf("u8=%d %d\n",
1152+ printf("u8=%d %d\n",
11531153 *(unsigned char *)&var1, *(unsigned char *)&var2);
1154− printf("s16=%d %d\n",
1154+ printf("s16=%d %d\n",
11551155 *(short *)&var1, *(short *)&var2);
1156− printf("u16=%d %d\n",
1156+ printf("u16=%d %d\n",
11571157 *(unsigned short *)&var1, *(unsigned short *)&var2);
1158− printf("s32=%d %d\n",
1158+ printf("s32=%d %d\n",
11591159 *(int *)&var1, *(int *)&var2);
1160− printf("u32=%d %d\n",
1160+ printf("u32=%d %d\n",
11611161 *(unsigned int *)&var1, *(unsigned int *)&var2);
11621162 *(signed char *)&var1 = 0x08;
11631163 printf("var1=%x\n", var1);
@@ -1304,7 +1304,7 @@ void bool_test() · 140 unmodified lines
13041304 static int v1 = 34 ? : -1; /* constant case */
13051305 static int v2 = 0 ? : -1; /* constant case */
13061306 int a = 30;
1307−
1307+
13081308 printf("%d %d\n", v1, v2);
13091309 printf("%d %d\n", a - 30 ? : a * 2, a + 1 ? : a * 2);
13101310 }
@@ -1467,7 +1467,7 @@ static int tentative_ar[]; · 156 unmodified lines
14671467 static int tentative_ar[] = {1,2,3};
14681468
14691469 int cinit1; /* a global variable can be defined several times without error ! */
1470−int cinit1;
1470+int cinit1;
14711471 int cinit1 = 0;
14721472 int *cinit2 = (int []){3, 2, 1};
14731473 uintptr_t cinit3 = (uintptr_t)"AA";
@@ -1526,7 +1526,7 @@ void compound_literal_test(void) · 52 unmodified lines
15261526
15271527 for(i=0;i<3;i++) {
15281528 p = (int []){1, 2, 4 + i};
1529− printf("%d %d %d\n",
1529+ printf("%d %d %d\n",
15301530 p[0],
15311531 p[1],
15321532 p[2]);
@@ -1566,7 +1566,7 @@ char invalid_function_def()[] {return 0;} · 33 unmodified lines
15661566 void num(int n)
15671567 {
15681568 char *tab, *p;
1569− tab = (char*)malloc(20);
1569+ tab = (char*)malloc(20);
15701570 p = tab;
15711571 while (1) {
15721572 *p = 48 + (n % 10);
@@ -1607,7 +1607,7 @@ void struct_assign_test(void) · 34 unmodified lines
16071607 struct structa1 lsta1, lsta2;
16081608 int i;
16091609 } s = {{1,2}, {3,4}}, *ps;
1610−
1610+
16111611 ps = &s;
16121612 ps->i = 4;
16131613
@@ -1667,9 +1667,9 @@ void cast_test() · 53 unmodified lines
16671667 printf("%d\n", a);
16681668 a = (scast = 65536) + 1;
16691669 printf("%d\n", a);
1670−
1670+
16711671 printf("sizeof(c) = %d, sizeof((int)c) = %d\n", sizeof(c), sizeof((int)c));
1672−
1672+
16731673 /* test cast from unsigned to signed short to int */
16741674 b = 0xf000;
16751675 d = (short)b;
@@ -1677,7 +1677,7 @@ void cast_test() · 1 unmodified line
16771677 b = 0xf0f0;
16781678 d = (char)b;
16791679 printf("((unsigned)(char)0x%08x) = 0x%08x\n", b, d);
1680−
1680+
16811681 /* test implicit int casting for array accesses */
16821682 c = 0;
16831683 tab[1] = 2;
@@ -1724,7 +1724,7 @@ char sinit8[] = "hello" "trala"; · 40 unmodified lines
17241724
17251725 struct structinit1 sinit9 = { 1, 2, 3 };
17261726 struct structinit1 sinit10 = { .f2 = 2, 3, .f1 = 1 };
1727−struct structinit1 sinit11 = { .f2 = 2, 3, .f1 = 1,
1727+struct structinit1 sinit11 = { .f2 = 2, 3, .f1 = 1,
17281728 #ifdef ALL_ISOC99
17291729 .farray[0] = 10,
17301730 .farray[1] = 11,
@@ -1849,34 +1849,34 @@ void init_test(void) · 118 unmodified lines
18491849 struct bf_SS bfaa_finit[3] = { [1].bit = 1 };
18501850 struct bf_SS bfaa_fvinit[] = { [2].bit = 1 };
18511851 struct b2_SS bf_finit2 = {0xFFF000FFF000FLL, 0x123};
1852−
1852+
18531853 printf("sinit1=%d\n", sinit1);
18541854 printf("sinit2=%d\n", sinit2);
1855− printf("sinit3=%d %d %d %d\n",
1855+ printf("sinit3=%d %d %d %d\n",
18561856 sizeof(sinit3),
18571857 sinit3[0],
18581858 sinit3[1],
18591859 sinit3[2]
18601860 );
18611861 printf("sinit6=%d\n", sizeof(sinit6));
1862− printf("sinit7=%d %d %d %d\n",
1862+ printf("sinit7=%d %d %d %d\n",
18631863 sizeof(sinit7),
18641864 sinit7[0],
18651865 sinit7[1],
18661866 sinit7[2]
18671867 );
18681868 printf("sinit8=%s\n", sinit8);
1869− printf("sinit9=%d %d %d\n",
1869+ printf("sinit9=%d %d %d\n",
18701870 sinit9.f1,
18711871 sinit9.f2,
18721872 sinit9.f3
18731873 );
1874− printf("sinit10=%d %d %d\n",
1874+ printf("sinit10=%d %d %d\n",
18751875 sinit10.f1,
18761876 sinit10.f2,
18771877 sinit10.f3
18781878 );
1879− printf("sinit11=%d %d %d %d %d %d\n",
1879+ printf("sinit11=%d %d %d %d %d %d\n",
18801880 sinit11.f1,
18811881 sinit11.f2,
18821882 sinit11.f3,
@@ -1887,7 +1887,7 @@ void init_test(void) · 4 unmodified lines
18871887
18881888 for(i=0;i<3;i++)
18891889 for(j=0;j<2;j++)
1890− printf("[%d][%d] = %d %d %d\n",
1890+ printf("[%d][%d] = %d %d %d\n",
18911891 i, j, sinit4[i][j], sinit5[i][j], linit4[i][j]);
18921892 printf("linit1=%d\n", linit1);
18931893 printf("linit2=%d\n", linit2);
@@ -1896,7 +1896,7 @@ void init_test(void) · 2 unmodified lines
18961896
18971897 printf("sinit12=%s\n", sinit12);
18981898 printf("sinit13=%d %s %s %s\n",
1899− sizeof(sinit13),
1899+ sizeof(sinit13),
19001900 sinit13[0],
19011901 sinit13[1],
19021902 sinit13[2]);
@@ -1910,7 +1910,7 @@ void init_test(void) · 7 unmodified lines
19101910 printf("\n");
19111911 for(i=0;i<10;i++) printf(" %d", linit15[i]);
19121912 printf("\n");
1913− printf("%d %d %d %d\n",
1913+ printf("%d %d %d %d\n",
19141914 linit16.a1,
19151915 linit16.a2,
19161916 linit16.a3,
@@ -2129,13 +2129,13 @@ void bitfield_test(void) · 212 unmodified lines
21292129 printf("%d %d\n", sa, ca);
21302130
21312131 st1.f1 = 7;
2132− if (st1.f1 == -1)
2132+ if (st1.f1 == -1)
21332133 printf("st1.f1 == -1\n");
2134− else
2134+ else
21352135 printf("st1.f1 != -1\n");
2136− if (st1.f2 == -1)
2136+ if (st1.f2 == -1)
21372137 printf("st1.f2 == -1\n");
2138− else
2138+ else
21392139 printf("st1.f2 != -1\n");
21402140
21412141 struct sbf2 {
@@ -2447,7 +2447,7 @@ void lloptest(long long a, long long b) · 305 unmodified lines
24472447 a + b,
24482448 a - b,
24492449 a * b);
2450−
2450+
24512451 if (b != 0) {
24522452 printf("arith1: " LONG_LONG_FORMAT " " LONG_LONG_FORMAT "\n",
24532453 a / b,
@@ -2468,7 +2468,7 @@ void lloptest(long long a, long long b) · 14 unmodified lines
24682468 a > b,
24692469 a >= b,
24702470 a <= b);
2471−
2471+
24722472 printf("utest: %d %d %d %d %d %d\n",
24732473 ua == ub,
24742474 ua != ub,
@@ -2544,7 +2544,7 @@ long long llfunc1(int a) · 69 unmodified lines
25442544 }
25452545
25462546 struct S {
2547− int id;
2547+ int id;
25482548 char item;
25492549 };
25502550
@@ -2701,7 +2701,7 @@ void vprintf1(const char *fmt, ...) · 150 unmodified lines
27012701
27022702 va_start(aq, fmt);
27032703 va_copy(ap, aq);
2704−
2704+
27052705 p = fmt;
27062706 for(;;) {
27072707 c = *p;
@@ -2987,10 +2987,10 @@ void c99_vla_test_1(int size1, int size2) · 279 unmodified lines
29872987 int tab1[size][2], tab2[10][2];
29882988 void *tab1_ptr, *tab2_ptr, *bad_ptr;
29892989
2990− /* "size" should have been 'captured' at tab1 declaration,
2990+ /* "size" should have been 'captured' at tab1 declaration,
29912991 so modifying it should have no effect on VLA behaviour. */
29922992 size = size-1;
2993−
2993+
29942994 printf("Test C99 VLA 1 (sizeof): ");
29952995 printf("%s\n", (sizeof tab1 == size1 * size2 * 2 * sizeof(int)) ? "PASSED" : "FAILED");
29962996 tab1_ptr = tab1;
@@ -3143,7 +3143,7 @@ void sizeof_test(void) · 146 unmodified lines
31433143 t <<= 16;
31443144 t <<= 16;
31453145 t++;
3146− /* This checks that sizeof really can be used to manipulate
3146+ /* This checks that sizeof really can be used to manipulate
31473147 uintptr_t objects, without truncation. */
31483148 t2 = t & -sizeof(uintptr_t);
31493149 printf ("%lu %lu\n", t, t2);
@@ -3209,15 +3209,15 @@ void statement_expr_test(void) · 59 unmodified lines
32093209 /* Basic stmt expr test */
32103210 a = 0;
32113211 for(i=0;i<10;i++) {
3212− a += 1 +
3213− ( { int b, j;
3214− b = 0;
3215− for(j=0;j<5;j++)
3216− b += j; b;
3212+ a += 1 +
3213+ ( { int b, j;
3214+ b = 0;
3215+ for(j=0;j<5;j++)
3216+ b += j; b;
32173217 } );
32183218 }
32193219 printf("a=%d\n", a);
3220−
3220+
32213221 /* Test that symbols aren't freed prematurely.
32223222 With SYM_DEBUG valgrind will show a read from a freed
32233223 symbol, and tcc will show an (invalid) warning on the initialization
@@ -4062,7 +4062,7 @@ void __attribute__((weak)) weak_test(void) · 838 unmodified lines
40624062 printf("weak_fpa=%d\n",&weak_fpa ? weak_fpa() : 123);
40634063 printf("weak_fpb=%d\n",&weak_fpb ? weak_fpb() : 123);
40644064 printf("weak_fpc=%d\n",&weak_fpc ? weak_fpc() : 123);
4065−
4065+
40664066 printf("weak_asm_f1=%d\n", weak_asm_f1 != NULL);
40674067 printf("weak_asm_f2=%d\n", weak_asm_f2 != NULL);
40684068 printf("weak_asm_f3=%d\n", weak_asm_f3 != NULL);
tests/vla_test.c+2−2
@@ -18,13 +18,13 @@ void smash(char *p, int n) { · 17 unmodified lines
1818 int test1(int n) {
1919 int i;
2020 char *array_ptrs[LOOP_COUNT];
21−
21+
2222 for (i = 0; i < LOOP_COUNT; ++i) {
2323 char test[n];
2424 smash(test, n);
2525 array_ptrs[i] = test;
2626 }
27−
27+
2828 return (array_ptrs[0]-array_ptrs[LOOP_COUNT-1] < n) ? 0 : 1;
2929 }
3030
texi2pod.pl+1−1
@@ -229,7 +229,7 @@ while(<$inf>) { · 228 unmodified lines
229229 $inf = gensym();
230230
231231 # Try cwd and $ibase.
232− open($inf, "<" . $1)
232+ open($inf, "<" . $1)
233233 or open($inf, "<" . $ibase . "/" . $1)
234234 or die "cannot open $1 or $ibase/$1: $!\n";
235235 next;
win32/tcc-win32.txt+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 Installation from the binary ZIP package:
1010 -----------------------------------------
1111 Unzip the package to a directory of your choice.
12−
12+
1313
1414 Set the system PATH:
1515 --------------------
x86_64-asm.h+1−1
@@ -108,7 +108,7 @@ ALT(DEF_ASM_OP2(lzcntw, 0xf30fbd, 0, OPC_MODRM | OPC_WLX, OPT_REGW | OPT_EA, OPT · 107 unmodified lines
108108 DEF_ASM_OP0(ud2, 0x0f0b)
109109
110110 /* NOTE: we took the same order as gas opcode definition order */
111−/* Right now we can't express the fact that 0xa1/0xa3 can't use $eax and a
111+/* Right now we can't express the fact that 0xa1/0xa3 can't use $eax and a
112112 32 bit moffset as operands.
113113 ALT(DEF_ASM_OP2(movb, 0xa0, 0, OPC_BWLX, OPT_ADDR, OPT_EAX))
114114 ALT(DEF_ASM_OP2(movb, 0xa2, 0, OPC_BWLX, OPT_EAX, OPT_ADDR)) */
x86_64-gen.c+24−24
@@ -670,7 +670,7 @@ static void gen_bounds_epilog(void) · 669 unmodified lines
670670 bounds_ptr = section_ptr_add(lbounds_section, sizeof(addr_t));
671671 *bounds_ptr = 0;
672672
673− sym_data = get_sym_ref(&char_pointer_type, lbounds_section,
673+ sym_data = get_sym_ref(&char_pointer_type, lbounds_section,
674674 func_bound_offset, PTR_SIZE);
675675
676676 /* generate bound local allocation */
@@ -795,7 +795,7 @@ void gfunc_call(int nb_args) · 118 unmodified lines
795795 struct_size = args_size;
796796 for(i = 0; i < nb_args; i++) {
797797 SValue *sv;
798−
798+
799799 --arg;
800800 sv = &vtop[-i];
801801 bt = (sv->type.t & VT_BTYPE);
@@ -870,7 +870,7 @@ void gfunc_call(int nb_args) · 68 unmodified lines
870870 vtop->type.t = size > 4 ? VT_LLONG : size > 2 ? VT_INT
871871 : size > 1 ? VT_SHORT : VT_BYTE;
872872 }
873−
873+
874874 r = gv(RC_INT);
875875 if (arg >= REGN) {
876876 gen_offs_sp(0x89, r, arg*8);
@@ -891,7 +891,7 @@ void gfunc_call(int nb_args) · 14 unmodified lines
891891 o(0xda894c); /* mov %r11, %rdx */
892892 }
893893 }
894−
894+
895895 gcall_or_jmp(0);
896896
897897 if ((vtop->r & VT_SYM) && vtop->sym->v == TOK_alloca) {
@@ -1066,10 +1066,10 @@ static X86_64_Mode classify_x86_64_inner(CType *ty) · 168 unmodified lines
10661066 {
10671067 X86_64_Mode mode;
10681068 Sym *f;
1069−
1069+
10701070 switch (ty->t & VT_BTYPE) {
10711071 case VT_VOID: return x86_64_mode_none;
1072−
1072+
10731073 case VT_INT:
10741074 case VT_BYTE:
10751075 case VT_SHORT:
@@ -1078,19 +1078,19 @@ static X86_64_Mode classify_x86_64_inner(CType *ty) · 2 unmodified lines
10781078 case VT_PTR:
10791079 case VT_FUNC:
10801080 return x86_64_mode_integer;
1081−
1081+
10821082 case VT_FLOAT:
10831083 case VT_DOUBLE: return x86_64_mode_sse;
1084−
1084+
10851085 case VT_LDOUBLE: return x86_64_mode_x87;
1086−
1086+
10871087 case VT_STRUCT:
10881088 f = ty->ref;
10891089
10901090 mode = x86_64_mode_none;
10911091 for (f = f->next; f; f = f->next)
10921092 mode = classify_x86_64_merge(mode, classify_x86_64_inner(&f->type));
1093−
1093+
10941094 return mode;
10951095 }
10961096 assert(0);
@@ -1101,7 +1101,7 @@ static X86_64_Mode classify_x86_64_arg(CType *ty, CType *ret, int *psize, int *p · 4 unmodified lines
11011101 {
11021102 X86_64_Mode mode;
11031103 int size, align, ret_t = 0;
1104−
1104+
11051105 if (ty->t & (VT_BITFIELD|VT_ARRAY)) {
11061106 *psize = 8;
11071107 *palign = 8;
@@ -1137,7 +1137,7 @@ static X86_64_Mode classify_x86_64_arg(CType *ty, CType *ret, int *psize, int *p · 29 unmodified lines
11371137 ret_t |= VT_UNSIGNED;
11381138 }
11391139 break;
1140−
1140+
11411141 case x86_64_mode_x87:
11421142 *reg_count = 1;
11431143 ret_t = VT_LDOUBLE;
@@ -1156,12 +1156,12 @@ static X86_64_Mode classify_x86_64_arg(CType *ty, CType *ret, int *psize, int *p · 12 unmodified lines
11561156 }
11571157 }
11581158 }
1159−
1159+
11601160 if (ret) {
11611161 ret->ref = NULL;
11621162 ret->t = ret_t;
11631163 }
1164−
1164+
11651165 return mode;
11661166 }
11671167
@@ -1446,13 +1446,13 @@ void gfunc_prolog(Sym *func_sym) · 278 unmodified lines
14461446 stack_arg:
14471447 seen_stack_size = ((seen_stack_size + align - 1) & -align) + size;
14481448 break;
1449−
1449+
14501450 case x86_64_mode_integer:
14511451 if (seen_reg_num + reg_count > REGN)
14521452 goto stack_arg;
14531453 seen_reg_num += reg_count;
14541454 break;
1455−
1455+
14561456 case x86_64_mode_sse:
14571457 if (seen_sse_num + reg_count > 8)
14581458 goto stack_arg;
@@ -1529,14 +1529,14 @@ void gfunc_prolog(Sym *func_sym) · 70 unmodified lines
15291529 addr += size;
15301530 }
15311531 break;
1532−
1532+
15331533 case x86_64_mode_memory:
15341534 case x86_64_mode_x87:
15351535 addr = (addr + align - 1) & -align;
15361536 param_addr = addr;
15371537 addr += size;
15381538 break;
1539−
1539+
15401540 case x86_64_mode_integer: {
15411541 if (reg_param_index + reg_count <= REGN) {
15421542 /* save arguments passed by register */
@@ -1931,7 +1931,7 @@ void gen_opf(int op) · 388 unmodified lines
19311931 vswap();
19321932 }
19331933 assert(!(vtop[-1].r & VT_LVAL));
1934−
1934+
19351935 if ((vtop->r & VT_SYM) && (vtop->sym->type.t & VT_TLS))
19361936 o(0x64); /* fs segment prefix */
19371937
@@ -1966,7 +1966,7 @@ void gen_opf(int op) · 28 unmodified lines
19661966 ft = vtop->type.t;
19671967 fc = vtop->c.i;
19681968 assert((ft & VT_BTYPE) != VT_LDOUBLE);
1969−
1969+
19701970 /* if saved lvalue, then we must reload it */
19711971 if ((vtop->r & VT_VALMASK) == VT_LLOCAL) {
19721972 SValue v1;
@@ -1979,7 +1979,7 @@ void gen_opf(int op) · 6 unmodified lines
19791979 fc = 0;
19801980 vtop->r = r | VT_LVAL;
19811981 }
1982−
1982+
19831983 assert(!(vtop[-1].r & VT_LVAL));
19841984 if (swapped) {
19851985 assert(vtop->r & VT_LVAL);
@@ -1987,7 +1987,7 @@ void gen_opf(int op) · 1 unmodified line
19871987 vswap();
19881988 fc = vtop->c.i; /* bcheck may have saved previous vtop[-1] */
19891989 }
1990−
1990+
19911991 if ((ft & VT_BTYPE) == VT_DOUBLE) {
19921992 o(0xf2);
19931993 } else {
@@ -1995,7 +1995,7 @@ void gen_opf(int op) · 1 unmodified line
19951995 }
19961996 o(0x0f);
19971997 opc = 0x58 + a;
1998−
1998+
19991999 gen_modrm32(opc, vtop[-1].r, vtop->r, vtop->sym, fc);
20002000 vtop--;
20012001 }
@@ -2053,7 +2053,7 @@ void gen_cvt_ftof(int t) · 51 unmodified lines
20532053 ft = vtop->type.t;
20542054 bt = ft & VT_BTYPE;
20552055 tbt = t & VT_BTYPE;
2056−
2056+
20572057 if (bt == VT_FLOAT) {
20582058 gv(RC_FLOAT);
20592059 if (tbt == VT_DOUBLE) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t