History

Trim trailing spaces everywhere.

gus knight committed 11 years ago

Commit 41031221 parent 5e67f2427 files · +430 −430Browse files

Unified · Split

27 files
  1. CMakeLists.txt +3 −3
  2. c67-gen.c +41 −41
  3. coff.h +6 −6
  4. configure +1 −1
  5. i386-asm.c +1 −1
  6. i386-asm.h +5 −5
  7. i386-gen.c +12 −12
  8. il-gen.c +7 −7
  9. il-opcodes.h +1 −1
  10. lib/bcheck.c +28 −28
  11. lib/libtcc1.c +13 −13
  12. libtcc.c +1 −1
  13. tcc-doc.texi +23 −23
  14. tcc.c +1 −1
  15. tcc.h +4 −4
  16. tccasm.c +25 −25
  17. tcccoff.c +2 −2
  18. tccelf.c +1 −1
  19. tccgen.c +110 −110
  20. tcclib.h +3 −3
  21. tccpe.c +1 −1
  22. tccpp.c +36 −36
  23. tcctok.h +1 −1
  24. tests/abitest.c +15 −15
  25. tests/tcctest.c +58 −58
  26. texi2pod.pl +1 −1
  27. x86_64-gen.c +30 −30
CMakeLists.txt+3−3
@@ -154,7 +154,7 @@ macro(make_tcc native_name cross_name cross_enabled definitions tcc_sources libt · 153 unmodified lines
154154 foreach(make_tcc_def ${TCC_NATIVE_DEFINITIONS})
155155 set(TCC_NATIVE_FLAGS ${TCC_NATIVE_FLAGS} -D${make_tcc_def})
156156 endforeach()
157−
157+
158158 if (TCC_BUILD_NATIVE)
159159 add_library(libtcc
160160 libtcc.c
@@ -179,7 +179,7 @@ macro(make_tcc native_name cross_name cross_enabled definitions tcc_sources libt · 18 unmodified lines
179179 endif()
180180 install(TARGETS tcc libtcc RUNTIME DESTINATION ${EXE_PATH} LIBRARY DESTINATION ${NATIVE_LIB_PATH} ARCHIVE DESTINATION ${NATIVE_LIB_PATH})
181181 set_target_properties(tcc libtcc PROPERTIES COMPILE_DEFINITIONS "${TCC_NATIVE_DEFINITIONS}")
182−
182+
183183 if("${libtcc_sources}" STRGREATER "")
184184 make_libtcc1("" tcc "${libtcc_ar}" "${TCC_NATIVE_DEFINITIONS}" "${libtcc_includes}" "${libtcc_sources}")
185185 endif()
@@ -188,7 +188,7 @@ macro(make_tcc native_name cross_name cross_enabled definitions tcc_sources libt · 2 unmodified lines
188188 add_executable(${cross_name}-tcc tcc.c)
189189 set_target_properties(${cross_name}-tcc PROPERTIES COMPILE_DEFINITIONS "ONE_SOURCE;${definitions}")
190190 install(TARGETS ${cross_name}-tcc RUNTIME DESTINATION ${EXE_PATH})
191−
191+
192192 if("${libtcc_sources}" STRGREATER "")
193193 make_libtcc1(${cross_name} "${cross_name}-tcc" "${libtcc_ar}" "${definitions}" "${libtcc_includes}" "${libtcc_sources}")
194194 endif()
c67-gen.c+41−41
@@ -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
@@ -130,7 +130,7 @@ enum { · 123 unmodified lines
130130 #include "tcc.h"
131131
132132 ST_DATA const int reg_classes[NB_REGS] = {
133− /* eax */ RC_INT | RC_FLOAT | RC_EAX,
133+ /* eax */ RC_INT | RC_FLOAT | RC_EAX,
134134 // only allow even regs for floats (allow for doubles)
135135 /* ecx */ RC_INT | RC_ECX,
136136 /* edx */ RC_INT | RC_INT_BSIDE | RC_FLOAT | RC_EDX,
@@ -161,7 +161,7 @@ ST_DATA const int reg_classes[NB_REGS] = { · 24 unmodified lines
161161 // although tcc thinks it is passing parameters on the stack,
162162 // the C67 really passes up to the first 10 params in special
163163 // regs or regs pairs (for 64 bit params). So keep track of
164−// the stack offsets so we can translate to the appropriate
164+// the stack offsets so we can translate to the appropriate
165165 // reg (pair)
166166
167167 #define NoCallArgsPassedOnStack 10
@@ -246,7 +246,7 @@ void gsym(int t) · 78 unmodified lines
246246 gsym_addr(t, ind);
247247 }
248248
249−// these are regs that tcc doesn't really know about,
249+// these are regs that tcc doesn't really know about,
250250 // but assign them unique values so the mapping routines
251251 // can distinguish them
252252
@@ -298,7 +298,7 @@ int C67_map_regn(int r) · 45 unmodified lines
298298 return 0;
299299 }
300300
301−// mapping from tcc reg number to
301+// mapping from tcc reg number to
302302 // C67 register to condition code field
303303 //
304304 // valid condition code regs are:
@@ -343,15 +343,15 @@ int C67_map_regs(int r) · 38 unmodified lines
343343 else if (r >= TREG_C67_A4 && r <= TREG_C67_B13) // these form a pattern of alt pairs
344344 return (r & 2) >> 1;
345345 else if (r == C67_A0)
346− return 0; // set to A side
346+ return 0; // set to A side
347347 else if (r == C67_B2)
348− return 1; // set to B side
348+ return 1; // set to B side
349349 else if (r == C67_B3)
350350 return 1; // set to B side
351351 else if (r == C67_SP)
352− return 0x1; // set to SP (B15) B side
352+ return 0x1; // set to SP (B15) B side
353353 else if (r == C67_FP)
354− return 0x0; // set to FP (A15) A side
354+ return 0x0; // set to FP (A15) A side
355355 else
356356 ALWAYS_ASSERT(FALSE);
357357
@@ -420,7 +420,7 @@ void C67_asm(char *s, int a, int b, int c) · 62 unmodified lines
420420 (5 << 9) | //mode 5 = pos offset, base reg + off reg
421421 (0 << 8) | //r (LDDW bit 0)
422422 (0 << 7) | //y D1/D2 A side
423− (3 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
423+ (3 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
424424 (1 << 2) | //opcode
425425 (C67_map_regs(a) << 1) | //side of src
426426 (0 << 0)); //parallel
@@ -442,7 +442,7 @@ void C67_asm(char *s, int a, int b, int c) · 15 unmodified lines
442442 (5 << 9) | //mode 5 = pos offset, base reg + off reg
443443 (0 << 8) | //r (LDDW bit 0)
444444 (0 << 7) | //y D1/D2 A side
445− (3 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
445+ (3 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
446446 (1 << 2) | //opcode
447447 (C67_map_regs(a) << 1) | //side of src
448448 (0 << 0)); //parallel
@@ -464,7 +464,7 @@ void C67_asm(char *s, int a, int b, int c) · 15 unmodified lines
464464 (5 << 9) | //mode 5 = pos offset, base reg + off reg
465465 (0 << 8) | //r (LDDW bit 0)
466466 (0 << 7) | //y D1/D2 A side
467− (7 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
467+ (7 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
468468 (1 << 2) | //opcode
469469 (C67_map_regs(a) << 1) | //side of src
470470 (0 << 0)); //parallel
@@ -475,7 +475,7 @@ void C67_asm(char *s, int a, int b, int c) · 4 unmodified lines
475475 (1 << 9) | //mode 1 = pos cst offset
476476 (0 << 8) | //r (LDDW bit 0)
477477 (C67_map_regs(b) << 7) | //y D1/D2 base reg side
478− (7 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
478+ (7 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
479479 (1 << 2) | //opcode
480480 (C67_map_regs(a) << 1) | //side of src
481481 (0 << 0)); //parallel
@@ -486,7 +486,7 @@ void C67_asm(char *s, int a, int b, int c) · 4 unmodified lines
486486 (1 << 9) | //mode 1 = pos cst offset
487487 (0 << 8) | //r (LDDW bit 0)
488488 (C67_map_regs(b) << 7) | //y D1/D2 base reg side
489− (5 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
489+ (5 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
490490 (1 << 2) | //opcode
491491 (C67_map_regs(a) << 1) | //side of src
492492 (0 << 0)); //parallel
@@ -497,7 +497,7 @@ void C67_asm(char *s, int a, int b, int c) · 4 unmodified lines
497497 (1 << 9) | //mode 1 = pos cst offset
498498 (0 << 8) | //r (LDDW bit 0)
499499 (C67_map_regs(b) << 7) | //y D1/D2 base reg side
500− (3 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
500+ (3 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
501501 (1 << 2) | //opcode
502502 (C67_map_regs(a) << 1) | //side of src
503503 (0 << 0)); //parallel
@@ -509,7 +509,7 @@ void C67_asm(char *s, int a, int b, int c) · 5 unmodified lines
509509 (1 << 9) | //mode 1 = pos cst offset
510510 (0 << 8) | //r (LDDW bit 0)
511511 (C67_map_regs(b) << 7) | //y D1/D2 base reg side
512− (7 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
512+ (7 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
513513 (1 << 2) | //opcode
514514 (C67_map_regs(a) << 1) | //side of src
515515 (0 << 0)); //parallel
@@ -641,7 +641,7 @@ void C67_asm(char *s, int a, int b, int c) · 125 unmodified lines
641641 (1 << 9) | //mode 1 = pos cst offset
642642 (0 << 8) | //r (LDDW bit 0)
643643 (C67_map_regs(a) << 7) | //y D1/D2 src side
644− (2 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
644+ (2 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
645645 (1 << 2) | //opcode
646646 (C67_map_regs(b) << 1) | //side of dst
647647 (0 << 0)); //parallel
@@ -652,7 +652,7 @@ void C67_asm(char *s, int a, int b, int c) · 4 unmodified lines
652652 (1 << 9) | //mode 1 = pos cst offset
653653 (0 << 8) | //r (LDDW bit 0)
654654 (C67_map_regs(a) << 7) | //y D1/D2 src side
655− (0 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
655+ (0 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
656656 (1 << 2) | //opcode
657657 (C67_map_regs(b) << 1) | //side of dst
658658 (0 << 0)); //parallel
@@ -674,7 +674,7 @@ void C67_asm(char *s, int a, int b, int c) · 15 unmodified lines
674674 (1 << 9) | //mode 1 = pos cst offset
675675 (0 << 8) | //r (LDDW bit 0)
676676 (C67_map_regs(a) << 7) | //y D1/D2 src side
677− (6 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
677+ (6 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU
678678 (1 << 2) | //opcode
679679 (C67_map_regs(b) << 1) | //side of dst
680680 (0 << 0)); //parallel
@@ -877,7 +877,7 @@ void C67_asm(char *s, int a, int b, int c) · 196 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 (0x4a << 5) | //opcode
@@ -890,7 +890,7 @@ void C67_asm(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 (0x49 << 5) | //opcode
@@ -903,7 +903,7 @@ void C67_asm(char *s, int a, int b, int c) · 6 unmodified lines
903903 C67_g((0 << 29) | //creg
904904 (0 << 28) | //inv
905905 (C67_map_regn(c) << 23) | //dst
906− (C67_map_regn(b) << 18) | //src2
906+ (C67_map_regn(b) << 18) | //src2
907907 (0 << 13) | //src1 NA
908908 (xpath << 12) | //x cross path if opposite sides
909909 (0x39 << 5) | //opcode
@@ -958,7 +958,7 @@ void C67_asm(char *s, int a, int b, int c) · 48 unmodified lines
958958 (0 << 28) | //inv
959959 (C67_map_regn(c) << 23) | //dst
960960 (C67_map_regn(b) << 18) | //src2 (possible x path)
961− (C67_map_regn(a) << 13) | //src1
961+ (C67_map_regn(a) << 13) | //src1
962962 (xpath << 12) | //x cross path if opposite sides
963963 (0x3 << 5) | //opcode
964964 (0x6 << 2) | //opcode fixed
@@ -973,7 +973,7 @@ void C67_asm(char *s, int a, int b, int c) · 8 unmodified lines
973973 (0 << 28) | //inv
974974 (C67_map_regn(c) << 23) | //dst
975975 (C67_map_regn(b) << 18) | //src2 (possible x path)
976− (C67_map_regn(a) << 13) | //src1
976+ (C67_map_regn(a) << 13) | //src1
977977 (xpath << 12) | //x cross path if opposite sides
978978 (0x7 << 5) | //opcode
979979 (0x6 << 2) | //opcode fixed
@@ -988,7 +988,7 @@ void C67_asm(char *s, int a, int b, int c) · 8 unmodified lines
988988 (0 << 28) | //inv
989989 (C67_map_regn(c) << 23) | //dst
990990 (C67_map_regn(b) << 18) | //src2 (possible x path)
991− (C67_map_regn(a) << 13) | //src1
991+ (C67_map_regn(a) << 13) | //src1
992992 (xpath << 12) | //x cross path if opposite sides
993993 (0x7f << 5) | //opcode
994994 (0x6 << 2) | //opcode fixed
@@ -1003,7 +1003,7 @@ void C67_asm(char *s, int a, int b, int c) · 8 unmodified lines
10031003 (0 << 28) | //inv
10041004 (C67_map_regn(c) << 23) | //dst
10051005 (C67_map_regn(b) << 18) | //src2 (possible x path)
1006− (C67_map_regn(a) << 13) | //src1
1006+ (C67_map_regn(a) << 13) | //src1
10071007 (xpath << 12) | //x cross path if opposite sides
10081008 (0x7b << 5) | //opcode
10091009 (0x6 << 2) | //opcode fixed
@@ -1018,7 +1018,7 @@ void C67_asm(char *s, int a, int b, int c) · 8 unmodified lines
10181018 (0 << 28) | //inv
10191019 (C67_map_regn(c) << 23) | //dst
10201020 (C67_map_regn(b) << 18) | //src2 (possible x path)
1021− (C67_map_regn(a) << 13) | //src1
1021+ (C67_map_regn(a) << 13) | //src1
10221022 (xpath << 12) | //x cross path if opposite sides
10231023 (0x6f << 5) | //opcode
10241024 (0x6 << 2) | //opcode fixed
@@ -1033,7 +1033,7 @@ void C67_asm(char *s, int a, int b, int c) · 8 unmodified lines
10331033 (0 << 28) | //inv
10341034 (C67_map_regn(c) << 23) | //dst
10351035 (C67_map_regn(b) << 18) | //src2 (possible x path)
1036− (C67_map_regn(a) << 13) | //src1
1036+ (C67_map_regn(a) << 13) | //src1
10371037 (xpath << 12) | //x cross path if opposite sides
10381038 (0x10 << 5) | //opcode
10391039 (0x6 << 2) | //opcode fixed
@@ -1048,7 +1048,7 @@ void C67_asm(char *s, int a, int b, int c) · 8 unmodified lines
10481048 (0 << 28) | //inv
10491049 (C67_map_regn(c) << 23) | //dst
10501050 (C67_map_regn(b) << 18) | //src2 (possible x path)
1051− (C67_map_regn(a) << 13) | //src1
1051+ (C67_map_regn(a) << 13) | //src1
10521052 (xpath << 12) | //x cross path if opposite sides
10531053 (0x18 << 5) | //opcode
10541054 (0x6 << 2) | //opcode fixed
@@ -1063,7 +1063,7 @@ void C67_asm(char *s, int a, int b, int c) · 8 unmodified lines
10631063 (0 << 28) | //inv
10641064 (C67_map_regn(c) << 23) | //dst
10651065 (C67_map_regn(b) << 18) | //src2 (possible x path)
1066− (C67_map_regn(a) << 13) | //src1
1066+ (C67_map_regn(a) << 13) | //src1
10671067 (xpath << 12) | //x cross path if opposite sides
10681068 (0x11 << 5) | //opcode
10691069 (0x6 << 2) | //opcode fixed
@@ -1078,7 +1078,7 @@ void C67_asm(char *s, int a, int b, int c) · 8 unmodified lines
10781078 (0 << 28) | //inv
10791079 (C67_map_regn(c) << 23) | //dst
10801080 (C67_map_regn(b) << 18) | //src2 (possible x path)
1081− (C67_map_regn(a) << 13) | //src1
1081+ (C67_map_regn(a) << 13) | //src1
10821082 (xpath << 12) | //x cross path if opposite sides
10831083 (0x19 << 5) | //opcode
10841084 (0x6 << 2) | //opcode fixed
@@ -1093,7 +1093,7 @@ void C67_asm(char *s, int a, int b, int c) · 8 unmodified lines
10931093 (0 << 28) | //inv
10941094 (C67_map_regn(c) << 23) | //dst
10951095 (C67_map_regn(b) << 18) | //src2 (possible x path)
1096− (C67_map_regn(a) << 13) | //src1
1096+ (C67_map_regn(a) << 13) | //src1
10971097 (xpath << 12) | //x cross path if opposite sides
10981098 (0x1c << 7) | //opcode
10991099 (0x0 << 2) | //opcode fixed
@@ -1108,7 +1108,7 @@ void C67_asm(char *s, int a, int b, int c) · 8 unmodified lines
11081108 (0 << 28) | //inv
11091109 (C67_map_regn(c) << 23) | //dst
11101110 (C67_map_regn(b) << 18) | //src2 (possible x path)
1111− (C67_map_regn(a) << 13) | //src1
1111+ (C67_map_regn(a) << 13) | //src1
11121112 (xpath << 12) | //x cross path if opposite sides
11131113 (0x0e << 7) | //opcode
11141114 (0x0 << 2) | //opcode fixed
@@ -1138,7 +1138,7 @@ void C67_asm(char *s, int a, int b, int c) · 23 unmodified lines
11381138 (0 << 28) | //inv
11391139 (C67_map_regn(c) << 23) | //dst
11401140 (C67_map_regn(b) << 18) | //src2
1141− (C67_map_regn(a) << 13) | //src1
1141+ (C67_map_regn(a) << 13) | //src1
11421142 (xpath << 12) | //x cross path if opposite sides
11431143 (0x37 << 6) | //opcode
11441144 (0x8 << 2) | //opcode fixed
@@ -1153,7 +1153,7 @@ void C67_asm(char *s, int a, int b, int c) · 8 unmodified lines
11531153 (0 << 28) | //inv
11541154 (C67_map_regn(c) << 23) | //dst
11551155 (C67_map_regn(b) << 18) | //src2
1156− (C67_map_regn(a) << 13) | //src1
1156+ (C67_map_regn(a) << 13) | //src1
11571157 (xpath << 12) | //x cross path if opposite sides
11581158 (0x27 << 6) | //opcode
11591159 (0x8 << 2) | //opcode fixed
@@ -1168,7 +1168,7 @@ void C67_asm(char *s, int a, int b, int c) · 8 unmodified lines
11681168 (0 << 28) | //inv
11691169 (C67_map_regn(c) << 23) | //dst
11701170 (C67_map_regn(b) << 18) | //src2
1171− (C67_map_regn(a) << 13) | //src1
1171+ (C67_map_regn(a) << 13) | //src1
11721172 (xpath << 12) | //x cross path if opposite sides
11731173 (0x33 << 6) | //opcode
11741174 (0x8 << 2) | //opcode fixed
@@ -1597,7 +1597,7 @@ void load(int r, SValue * sv) · 422 unmodified lines
15971597 size = 4;
15981598 }
15991599
1600− // check if fc is a positive reference on the stack,
1600+ // check if fc is a positive reference on the stack,
16011601 // if it is tcc is referencing what it thinks is a parameter
16021602 // on the stack, so check if it is really in a register.
16031603
@@ -1962,7 +1962,7 @@ void gfunc_call(int nb_args) · 358 unmodified lines
19621962 // ending with B12:B13.
19631963 //
19641964 // When a call is made, if the caller has its parameters
1965−// in regs A4-B13 these must be saved before/as the call
1965+// in regs A4-B13 these must be saved before/as the call
19661966 // parameters are loaded and restored upon return (or if/when needed).
19671967
19681968 /* generate function prolog of type 't' */
@@ -2033,7 +2033,7 @@ void gfunc_prolog(CType * func_type) · 64 unmodified lines
20332033
20342034 TotalBytesPushedOnStack = -loc;
20352035
2036− func_sub_sp_offset = ind; // remember where we put the stack instruction
2036+ func_sub_sp_offset = ind; // remember where we put the stack instruction
20372037 C67_ADDK(0, C67_SP); // ADDK.L2 loc,SP (just put zero temporarily)
20382038
20392039 C67_PUSH(C67_A0);
@@ -2049,11 +2049,11 @@ void gfunc_epilog(void) · 9 unmodified lines
20492049 C67_NOP(4); // NOP wait for load
20502050 C67_IREG_B_REG(0, C67_CREG_ZERO, C67_B3); // B.S2 B3
20512051 C67_POP(C67_FP);
2052− C67_ADDK(local, C67_SP); // ADDK.L2 loc,SP
2052+ C67_ADDK(local, C67_SP); // ADDK.L2 loc,SP
20532053 C67_Adjust_ADDK((int *) (cur_text_section->data +
20542054 func_sub_sp_offset),
20552055 -local + TotalBytesPushedOnStack);
2056− C67_NOP(3); // NOP
2056+ C67_NOP(3); // NOP
20572057 }
20582058 }
20592059
coff.h+6−6
@@ -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
@@ -68,7 +68,7 @@ typedef struct aouthdr { · 28 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 */
@@ -164,7 +164,7 @@ struct scnhdr { · 89 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 */
@@ -358,11 +358,11 @@ struct syment · 187 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)
configure+1−1
@@ -66,7 +66,7 @@ case $targetos in · 65 unmodified lines
6666 esac
6767
6868 # find source path
69−# XXX: we assume an absolute path is given when launching configure,
69+# XXX: we assume an absolute path is given when launching configure,
7070 # except in './configure' case.
7171 source_path=${0%configure}
7272 source_path=${source_path%/}
i386-asm.c+1−1
@@ -712,7 +712,7 @@ ST_FUNC void asm_opcode(TCCState *s1, int opcode) · 711 unmodified lines
712712 a32 = addr32 = 1;
713713 }
714714 #endif
715− if (b & 0xff00)
715+ if (b & 0xff00)
716716 g(b >> 8);
717717 g(b);
718718 return;
i386-asm.h+5−5
@@ -57,7 +57,7 @@ ALT(DEF_ASM_OP0L(stosb, 0xaa, 0, OPC_BWL)) · 56 unmodified lines
5757 ALT(DEF_ASM_OP0L(sstob, 0xaa, 0, OPC_BWL))
5858
5959 /* bits */
60−
60+
6161 ALT(DEF_ASM_OP2(bsfw, 0x0fbc, 0, OPC_MODRM | OPC_WL, OPT_REGW | OPT_EA, OPT_REGW))
6262 ALT(DEF_ASM_OP2(bsrw, 0x0fbd, 0, OPC_MODRM | OPC_WL, OPT_REGW | OPT_EA, OPT_REGW))
6363
@@ -91,7 +91,7 @@ ALT(DEF_ASM_OP2(btcw, 0x0fba, 7, OPC_MODRM | OPC_WL, OPT_IM8, OPT_REGW | OPT_EA) · 27 unmodified lines
9191 DEF_ASM_OP0(repz, 0xf3)
9292 DEF_ASM_OP0(repne, 0xf2)
9393 DEF_ASM_OP0(repnz, 0xf2)
94−
94+
9595 DEF_ASM_OP0(invd, 0x0f08)
9696 DEF_ASM_OP0(wbinvd, 0x0f09)
9797 DEF_ASM_OP0(cpuid, 0x0fa2)
@@ -236,7 +236,7 @@ ALT(DEF_ASM_OP1(jo, 0x70, 0, OPC_SHORTJMP | OPC_JMP | OPC_TEST, OPT_ADDR)) · 138 unmodified lines
236236 DEF_ASM_OP1(loopz, 0xe1, 0, OPC_SHORTJMP, OPT_ADDR)
237237 DEF_ASM_OP1(loop, 0xe2, 0, OPC_SHORTJMP, OPT_ADDR)
238238 DEF_ASM_OP1(jecxz, 0xe3, 0, OPC_SHORTJMP, OPT_ADDR)
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)
@@ -380,7 +380,7 @@ ALT(DEF_ASM_OP2(cmpxchgb, 0x0fb0, 0, OPC_MODRM | OPC_BWL, OPT_REG, OPT_REG | OPT · 75 unmodified lines
380380
381381 /* pentium */
382382 DEF_ASM_OP1(cmpxchg8b, 0x0fc7, 1, OPC_MODRM, OPT_EA )
383−
383+
384384 /* pentium pro */
385385 ALT(DEF_ASM_OP2(cmovo, 0x0f40, 0, OPC_MODRM | OPC_TEST, OPT_REG32 | OPT_EA, OPT_REG32))
386386 #ifdef I386_ASM_16
i386-gen.c+12−12
@@ -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
@@ -32,7 +32,7 @@ typedef int RegArgs; · 25 unmodified lines
3232 #define RC_INT 0x0001 /* generic integer register */
3333 #define RC_FLOAT 0x0002 /* generic float register */
3434 #define RC_EAX 0x0004
35−#define RC_ST0 0x0008
35+#define RC_ST0 0x0008
3636 #define RC_ECX 0x0010
3737 #define RC_EDX 0x0020
3838 #define RC_IRET RC_EAX /* function return: integer register */
@@ -357,11 +357,11 @@ static void gcall_or_jmp(int is_jmp) · 318 unmodified lines
357357 /* constant case */
358358 if (vtop->r & VT_SYM) {
359359 /* relocation case */
360− greloc(cur_text_section, vtop->sym,
360+ greloc(cur_text_section, vtop->sym,
361361 ind + 1, R_386_PC32);
362362 } else {
363363 /* put an empty PC32 relocation */
364− put_elf_reloc(symtab_section, cur_text_section,
364+ put_elf_reloc(symtab_section, cur_text_section,
365365 ind + 1, R_386_PC32, 0);
366366 }
367367 oad(0xe8 + is_jmp, vtop->c.ul - 4); /* call/jmp im */
@@ -417,7 +417,7 @@ ST_FUNC void gfunc_call(int nb_args) · 49 unmodified lines
417417 {
418418 int size, align, r, args_size, i, func_call;
419419 Sym *func_sym;
420−
420+
421421 args_size = 0;
422422 for(i = 0;i < nb_args; i++) {
423423 if ((vtop->type.t & VT_BTYPE) == VT_STRUCT) {
@@ -610,7 +610,7 @@ ST_FUNC void gfunc_epilog(void) · 186 unmodified lines
610610 /* generate bound local allocation */
611611 saved_ind = ind;
612612 ind = func_sub_sp_offset;
613− sym_data = get_sym_ref(&char_pointer_type, lbounds_section,
613+ sym_data = get_sym_ref(&char_pointer_type, lbounds_section,
614614 func_bound_offset, lbounds_section->data_offset);
615615 greloc(cur_text_section, sym_data,
616616 ind + 1, R_386_32);
@@ -637,8 +637,8 @@ ST_FUNC void gfunc_epilog(void) · 20 unmodified lines
637637 g(func_ret_sub >> 8);
638638 }
639639 /* align local size to word & save local variables */
640−
641− v = (-loc + 3) & -4;
640+
641+ v = (-loc + 3) & -4;
642642 saved_ind = ind;
643643 ind = func_sub_sp_offset - FUNC_PROLOG_SIZE;
644644 #ifdef TCC_TARGET_PE
@@ -741,7 +741,7 @@ ST_FUNC void gen_opi(int op) · 96 unmodified lines
741741 r = vtop[-1].r;
742742 fr = vtop[0].r;
743743 o((opc << 3) | 0x01);
744− o(0xc0 + r + fr * 8);
744+ o(0xc0 + r + fr * 8);
745745 }
746746 vtop--;
747747 if (op >= TOK_ULT && op <= TOK_GT) {
@@ -911,7 +911,7 @@ ST_FUNC void gen_opf(int op) · 163 unmodified lines
911911 load(TREG_ST0, vtop);
912912 swapped = !swapped;
913913 }
914−
914+
915915 switch(op) {
916916 default:
917917 case '+':
@@ -972,7 +972,7 @@ ST_FUNC void gen_cvt_itof(int t) · 54 unmodified lines
972972 o(0x50 + (vtop->r & VT_VALMASK)); /* push r */
973973 o(0x242cdf); /* fildll (%esp) */
974974 o(0x08c483); /* add $8, %esp */
975− } else if ((vtop->type.t & (VT_BTYPE | VT_UNSIGNED)) ==
975+ } else if ((vtop->type.t & (VT_BTYPE | VT_UNSIGNED)) ==
976976 (VT_INT | VT_UNSIGNED)) {
977977 /* unsigned int to float/double/long double */
978978 o(0x6a); /* push $0 */
@@ -1060,7 +1060,7 @@ ST_FUNC void gen_bounded_ptr_add(void) · 81 unmodified lines
10601060 vtop++;
10611061 vtop->r = TREG_EAX | VT_BOUNDED;
10621062 /* address of bounding function call point */
1063− vtop->c.ul = (cur_text_section->reloc->data_offset - sizeof(Elf32_Rel));
1063+ vtop->c.ul = (cur_text_section->reloc->data_offset - sizeof(Elf32_Rel));
10641064 }
10651065
10661066 /* patch pointer addition in vtop so that pointer dereferencing is
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
@@ -112,7 +112,7 @@ static void init_outfile(void) · 105 unmodified lines
112112 {
113113 if (!il_outfile) {
114114 il_outfile = stdout;
115− fprintf(il_outfile,
115+ fprintf(il_outfile,
116116 ".assembly extern mscorlib\n"
117117 "{\n"
118118 ".ver 1:0:2411:0\n"
@@ -149,7 +149,7 @@ static void out_opi(int op, int c) · 30 unmodified lines
149149 }
150150
151151 /* XXX: not complete */
152−static void il_type_to_str(char *buf, int buf_size,
152+static void il_type_to_str(char *buf, int buf_size,
153153 int t, const char *varstr)
154154 {
155155 int bt;
@@ -301,12 +301,12 @@ void load(int r, SValue *sv) · 145 unmodified lines
301301 out_op(IL_OP_LDIND_U2);
302302 else
303303 out_op(IL_OP_LDIND_I4);
304− }
304+ }
305305 } else {
306306 if (v == VT_CONST) {
307307 /* XXX: handle globals */
308308 if (fc >= -1 && fc <= 8) {
309− out_op(IL_OP_LDC_I4_M1 + fc + 1);
309+ out_op(IL_OP_LDC_I4_M1 + fc + 1);
310310 } else {
311311 out_opi(IL_OP_LDC_I4, fc);
312312 }
@@ -430,10 +430,10 @@ void gfunc_prolog(int t) · 117 unmodified lines
430430 /* XXX: cannot do better now */
431431 fprintf(il_outfile, " .maxstack %d\n", NB_REGS);
432432 fprintf(il_outfile, " .locals (int32, int32, int32, int32, int32, int32, int32, int32)\n");
433−
433+
434434 if (!strcmp(funcname, "main"))
435435 fprintf(il_outfile, " .entrypoint\n");
436−
436+
437437 sym = sym_find((unsigned)t >> VT_STRUCT_SHIFT);
438438 func_call = sym->r;
439439
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+28−28
@@ -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
@@ -88,7 +88,7 @@ int __bound_delete_region(void *p); · 81 unmodified lines
8888
8989 #ifdef __attribute__
9090 /* an __attribute__ macro is defined in the system headers */
91− #undef __attribute__
91+ #undef __attribute__
9292 #endif
9393 #define FASTCALL __attribute__((regparm(3)))
9494
@@ -177,8 +177,8 @@ void * FASTCALL __bound_ptr_add(void *p, size_t offset) · 82 unmodified lines
177177 dprintf(stderr, "%s %s: %p %p\n", __FILE__, __FUNCTION__, p, offset);
178178
179179 e = __bound_t1[addr >> (BOUND_T2_BITS + BOUND_T3_BITS)];
180− e = (BoundEntry *)((char *)e +
181− ((addr >> (BOUND_T3_BITS - BOUND_E_BITS)) &
180+ e = (BoundEntry *)((char *)e +
181+ ((addr >> (BOUND_T3_BITS - BOUND_E_BITS)) &
182182 ((BOUND_T2_SIZE - 1) << BOUND_E_BITS)));
183183 addr -= e->start;
184184 if (addr > e->size) {
@@ -236,7 +236,7 @@ BOUND_PTR_INDIR(16) · 51 unmodified lines
236236 }
237237
238238 /* called when entering a function to add all the local regions */
239−void FASTCALL __bound_local_new(void *p1)
239+void FASTCALL __bound_local_new(void *p1)
240240 {
241241 size_t addr, size, fp, *p = p1;
242242
@@ -255,7 +255,7 @@ void FASTCALL __bound_local_new(void *p1) · 12 unmodified lines
255255 }
256256
257257 /* called when leaving a function to delete all the local regions */
258−void FASTCALL __bound_local_delete(void *p1)
258+void FASTCALL __bound_local_delete(void *p1)
259259 {
260260 size_t addr, fp, *p = p1;
261261 GET_CALLER_FP(fp);
@@ -331,14 +331,14 @@ static void mark_invalid(size_t addr, size_t size) · 69 unmodified lines
331331 #if 0
332332 dprintf(stderr, "mark_invalid: start = %x %x\n", t2_start, t2_end);
333333 #endif
334−
334+
335335 /* first we handle full pages */
336336 t1_start = (t2_start + BOUND_T2_SIZE - 1) >> BOUND_T2_BITS;
337337 t1_end = t2_end >> BOUND_T2_BITS;
338338
339339 i = t2_start & (BOUND_T2_SIZE - 1);
340340 j = t2_end & (BOUND_T2_SIZE - 1);
341−
341+
342342 if (t1_start == t1_end) {
343343 page = get_page(t2_start >> BOUND_T2_BITS);
344344 for(; i < j; i++) {
@@ -456,7 +456,7 @@ void __bound_main_arg(void **p) · 111 unmodified lines
456456 void *start = p;
457457 while (*p++);
458458
459− dprintf(stderr, "%s, %s calling __bound_new_region(%p, %p)\n",
459+ dprintf(stderr, "%s, %s calling __bound_new_region(%p, %p)\n",
460460 __FILE__, __FUNCTION__, (void *) p - start);
461461
462462 __bound_new_region(start, (void *) p - start);
@@ -467,7 +467,7 @@ void __bound_exit(void) · 4 unmodified lines
467467 restore_malloc_hooks();
468468 }
469469
470−static inline void add_region(BoundEntry *e,
470+static inline void add_region(BoundEntry *e,
471471 size_t start, size_t size)
472472 {
473473 BoundEntry *e1;
@@ -496,7 +496,7 @@ void __bound_new_region(void *p, size_t size) · 22 unmodified lines
496496
497497 __bound_init();
498498
499− dprintf(stderr, "%s, %s(%p, %p) start\n",
499+ dprintf(stderr, "%s, %s(%p, %p) start\n",
500500 __FILE__, __FUNCTION__, p, size);
501501
502502 start = (size_t)p;
@@ -506,9 +506,9 @@ void __bound_new_region(void *p, size_t size) · 3 unmodified lines
506506
507507 /* start */
508508 page = get_page(t1_start);
509− t2_start = (start >> (BOUND_T3_BITS - BOUND_E_BITS)) &
509+ t2_start = (start >> (BOUND_T3_BITS - BOUND_E_BITS)) &
510510 ((BOUND_T2_SIZE - 1) << BOUND_E_BITS);
511− t2_end = (end >> (BOUND_T3_BITS - BOUND_E_BITS)) &
511+ t2_end = (end >> (BOUND_T3_BITS - BOUND_E_BITS)) &
512512 ((BOUND_T2_SIZE - 1) << BOUND_E_BITS);
513513
514514
@@ -557,7 +557,7 @@ void __bound_new_region(void *p, size_t size) · 42 unmodified lines
557557 }
558558
559559 /* delete a region */
560−static inline void delete_region(BoundEntry *e,
560+static inline void delete_region(BoundEntry *e,
561561 void *p, size_t empty_size)
562562 {
563563 size_t addr;
@@ -612,9 +612,9 @@ int __bound_delete_region(void *p) · 48 unmodified lines
612612
613613 start = (size_t)p;
614614 t1_start = start >> (BOUND_T2_BITS + BOUND_T3_BITS);
615− t2_start = (start >> (BOUND_T3_BITS - BOUND_E_BITS)) &
615+ t2_start = (start >> (BOUND_T3_BITS - BOUND_E_BITS)) &
616616 ((BOUND_T2_SIZE - 1) << BOUND_E_BITS);
617−
617+
618618 /* find region size */
619619 page = __bound_t1[t1_start];
620620 e = (BoundEntry *)((char *)page + t2_start);
@@ -622,7 +622,7 @@ int __bound_delete_region(void *p) · 1 unmodified line
622622 if (addr > e->size)
623623 e = __bound_find_region(e, p);
624624 /* test if invalid region */
625− if (e->size == EMPTY_SIZE || (size_t)p != e->start)
625+ if (e->size == EMPTY_SIZE || (size_t)p != e->start)
626626 return -1;
627627 /* compute the size we put in invalid regions */
628628 if (e->is_invalid)
@@ -634,7 +634,7 @@ int __bound_delete_region(void *p) · 5 unmodified lines
634634
635635 /* now we can free each entry */
636636 t1_end = end >> (BOUND_T2_BITS + BOUND_T3_BITS);
637− t2_end = (end >> (BOUND_T3_BITS - BOUND_E_BITS)) &
637+ t2_end = (end >> (BOUND_T3_BITS - BOUND_E_BITS)) &
638638 ((BOUND_T2_SIZE - 1) << BOUND_E_BITS);
639639
640640 delete_region(e, p, empty_size);
@@ -690,8 +690,8 @@ static size_t get_region_size(void *p) · 49 unmodified lines
690690 BoundEntry *e;
691691
692692 e = __bound_t1[addr >> (BOUND_T2_BITS + BOUND_T3_BITS)];
693− e = (BoundEntry *)((char *)e +
694− ((addr >> (BOUND_T3_BITS - BOUND_E_BITS)) &
693+ e = (BoundEntry *)((char *)e +
694+ ((addr >> (BOUND_T3_BITS - BOUND_E_BITS)) &
695695 ((BOUND_T2_SIZE - 1) << BOUND_E_BITS)));
696696 addr -= e->start;
697697 if (addr > e->size)
@@ -756,16 +756,16 @@ static void libc_free(void *ptr) · 58 unmodified lines
756756 void *__bound_malloc(size_t size, const void *caller)
757757 {
758758 void *ptr;
759−
759+
760760 /* we allocate one more byte to ensure the regions will be
761761 separated by at least one byte. With the glibc malloc, it may
762762 be in fact not necessary */
763763 ptr = libc_malloc(size + 1);
764−
764+
765765 if (!ptr)
766766 return NULL;
767767
768− dprintf(stderr, "%s, %s calling __bound_new_region(%p, %p)\n",
768+ dprintf(stderr, "%s, %s calling __bound_new_region(%p, %p)\n",
769769 __FILE__, __FUNCTION__, ptr, size);
770770
771771 __bound_new_region(ptr, size);
@@ -792,13 +792,13 @@ void *__bound_memalign(size_t size, size_t align, const void *caller) · 20 unmodified lines
792792 be in fact not necessary */
793793 ptr = memalign(size + 1, align);
794794 #endif
795−
795+
796796 install_malloc_hooks();
797−
797+
798798 if (!ptr)
799799 return NULL;
800800
801− dprintf(stderr, "%s, %s calling __bound_new_region(%p, %p)\n",
801+ dprintf(stderr, "%s, %s calling __bound_new_region(%p, %p)\n",
802802 __FILE__, __FUNCTION__, ptr, size);
803803
804804 __bound_new_region(ptr, size);
@@ -862,8 +862,8 @@ static void bound_dump(void) · 57 unmodified lines
862862 e = page + j;
863863 /* do not print invalid or empty entries */
864864 if (e->size != EMPTY_SIZE && e->start != 0) {
865− fprintf(stderr, "%08x:",
866− (i << (BOUND_T2_BITS + BOUND_T3_BITS)) +
865+ fprintf(stderr, "%08x:",
866+ (i << (BOUND_T2_BITS + BOUND_T3_BITS)) +
867867 (j << BOUND_T3_BITS));
868868 do {
869869 fprintf(stderr, " %08lx:%08lx", e->start, e->start + e->size);
lib/libtcc1.c+13−13
@@ -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 #include <stdint.h>
@@ -370,10 +370,10 @@ long long __divdi3(long long u, long long v) · 338 unmodified lines
370370 int c = 0;
371371 DWunion uu, vv;
372372 DWtype w;
373−
373+
374374 uu.ll = u;
375375 vv.ll = v;
376−
376+
377377 if (uu.s.high < 0) {
378378 c = ~c;
379379 uu.ll = __negdi2 (uu.ll);
@@ -393,17 +393,17 @@ long long __moddi3(long long u, long long v) · 13 unmodified lines
393393 int c = 0;
394394 DWunion uu, vv;
395395 DWtype w;
396−
396+
397397 uu.ll = u;
398398 vv.ll = v;
399−
399+
400400 if (uu.s.high < 0) {
401401 c = ~c;
402402 uu.ll = __negdi2 (uu.ll);
403403 }
404404 if (vv.s.high < 0)
405405 vv.ll = __negdi2 (vv.ll);
406−
406+
407407 __udivmoddi4 (uu.ll, vv.ll, (UDWtype *) &w);
408408 if (c)
409409 w = __negdi2 (w);
@@ -418,7 +418,7 @@ unsigned long long __udivdi3(unsigned long long u, unsigned long long v) · 8 unmodified lines
418418 unsigned long long __umoddi3(unsigned long long u, unsigned long long v)
419419 {
420420 UDWtype w;
421−
421+
422422 __udivmoddi4 (u, v, &w);
423423 return w;
424424 }
@@ -499,7 +499,7 @@ long long __tcc_cvt_ftol(long double x) · 74 unmodified lines
499499 /* XXX: fix tcc's code generator to do this instead */
500500 float __floatundisf(unsigned long long a)
501501 {
502− DWunion uu;
502+ DWunion uu;
503503 XFtype r;
504504
505505 uu.ll = a;
@@ -514,7 +514,7 @@ float __floatundisf(unsigned long long a) · 8 unmodified lines
514514
515515 double __floatundidf(unsigned long long a)
516516 {
517− DWunion uu;
517+ DWunion uu;
518518 XFtype r;
519519
520520 uu.ll = a;
@@ -529,7 +529,7 @@ double __floatundidf(unsigned long long a) · 8 unmodified lines
529529
530530 long double __floatundixf(unsigned long long a)
531531 {
532− DWunion uu;
532+ DWunion uu;
533533 XFtype r;
534534
535535 uu.ll = a;
@@ -608,7 +608,7 @@ unsigned long long __fixunsxfdi (long double a1) · 72 unmodified lines
608608
609609 if (exp > 0)
610610 return (unsigned long long)-1;
611− else if (exp >= -63)
611+ else if (exp >= -63)
612612 return l >> -exp;
613613 else
614614 return 0;
libtcc.c+1−1
@@ -318,7 +318,7 @@ PUB_FUNC void tcc_free_debug(void *ptr) · 317 unmodified lines
318318
319319 mem_cur_size -= header->size;
320320 header->size = (size_t)-1;
321−
321+
322322 if (header->next)
323323 header->next->prev = header->prev;
324324
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
@@ -271,7 +271,7 @@ Make string constants be of type @code{const char *} instead of @code{char · 121 unmodified lines
271271 @item -Werror
272272 Abort compilation if warnings are issued.
273273
274−@item -Wall
274+@item -Wall
275275 Activate all warnings, except @option{-Werror}, @option{-Wunusupported} and
276276 @option{-Wwrite-strings}.
277277
@@ -451,7 +451,7 @@ function name. · 173 unmodified lines
451451
452452 int tab[10] = @{ 1, 2, [5] = 5, [9] = 9@};
453453 @end example
454−
454+
455455 @item Compound initializers are supported:
456456 @example
457457 int *p = (int [])@{ 1, 2, 3 @};
@@ -465,7 +465,7 @@ works for structures and strings. · 7 unmodified lines
465465 @end example
466466
467467 @noindent
468−is the same as writing
468+is the same as writing
469469 @example
470470 double d = 4771840.0;
471471 @end example
@@ -481,12 +481,12 @@ TCC implements some GNU C extensions: · 9 unmodified lines
481481
482482 @itemize
483483
484−@item array designators can be used without '=':
484+@item array designators can be used without '=':
485485 @example
486486 int a[10] = @{ [0] 1, [5] 2, 3, 4 @};
487487 @end example
488488
489−@item Structure field designators can be a label:
489+@item Structure field designators can be a label:
490490 @example
491491 struct @{ int x, y; @} st = @{ x: 1, y: 1@};
492492 @end example
@@ -555,7 +555,7 @@ Here are some examples: · 62 unmodified lines
555555 align variable @code{a} to 8 bytes and put it in section @code{.mysection}.
556556
557557 @example
558− int my_add(int a, int b) __attribute__ ((section(".mycodesection")))
558+ int my_add(int a, int b) __attribute__ ((section(".mycodesection")))
559559 @{
560560 return a + b;
561561 @}
@@ -572,17 +572,17 @@ generate function @code{my_add} in section @code{.mycodesection}. · 10 unmodified lines
572572 dprintf("one arg %d\n", 1);
573573 @end example
574574
575−@item @code{__FUNCTION__} is interpreted as C99 @code{__func__}
575+@item @code{__FUNCTION__} is interpreted as C99 @code{__func__}
576576 (so it has not exactly the same semantics as string literal GNUC
577577 where it is a string literal).
578578
579−@item The @code{__alignof__} keyword can be used as @code{sizeof}
579+@item The @code{__alignof__} keyword can be used as @code{sizeof}
580580 to get the alignment of a type or an expression.
581581
582−@item The @code{typeof(x)} returns the type of @code{x}.
582+@item The @code{typeof(x)} returns the type of @code{x}.
583583 @code{x} is an expression or a type.
584584
585−@item Computed gotos: @code{&&label} returns a pointer of type
585+@item Computed gotos: @code{&&label} returns a pointer of type
586586 @code{void *} on the goto label @code{label}. @code{goto *expr} can be
587587 used to jump on the pointer resulting from @code{expr}.
588588
@@ -616,7 +616,7 @@ TCC includes its own x86 inline assembler with a @code{gas}-like (GNU · 27 unmodified lines
616616 assembler) syntax. No intermediate files are generated. GCC 3.x named
617617 operands are supported.
618618
619−@item @code{__builtin_types_compatible_p()} and @code{__builtin_constant_p()}
619+@item @code{__builtin_types_compatible_p()} and @code{__builtin_constant_p()}
620620 are supported.
621621
622622 @item @code{#pragma pack} is supported for win32 compatibility.
@@ -681,7 +681,7 @@ same as C. · 58 unmodified lines
681681 @item +, -
682682 @end enumerate
683683
684−@item A value is either an absolute number or a label plus an offset.
684+@item A value is either an absolute number or a label plus an offset.
685685 All operators accept absolute values except '+' and '-'. '+' or '-' can be
686686 used to add an offset to a label. '-' supports two labels only if they
687687 are the same or if they are both defined and in the same section.
@@ -694,7 +694,7 @@ are the same or if they are both defined and in the same section. · 6 unmodified lines
694694
695695 @item All labels are considered as local, except undefined ones.
696696
697−@item Numeric labels can be used as local @code{gas}-like labels.
697+@item Numeric labels can be used as local @code{gas}-like labels.
698698 They can be defined several times in the same source. Use 'b'
699699 (backward) or 'f' (forward) as suffix to reference them:
700700
@@ -901,7 +901,7 @@ Here are some examples of caught errors: · 200 unmodified lines
901901 @chapter The @code{libtcc} library
902902
903903 The @code{libtcc} library enables you to use TCC as a backend for
904−dynamic code generation.
904+dynamic code generation.
905905
906906 Read the @file{libtcc.h} to have an overview of the API. Read
907907 @file{libtcc_test.c} to have a very simple example.
@@ -941,10 +941,10 @@ except: · 33 unmodified lines
941941
942942 @itemize
943943
944−@item For initialized arrays with unknown size, a first pass
944+@item For initialized arrays with unknown size, a first pass
945945 is done to count the number of elements.
946946
947−@item For architectures where arguments are evaluated in
947+@item For architectures where arguments are evaluated in
948948 reverse order, a first pass is done to reverse the argument order.
949949
950950 @end itemize
@@ -1156,7 +1156,7 @@ stack. · 205 unmodified lines
11561156 @item VT_CMP
11571157 indicates that the value is actually stored in the CPU flags (i.e. the
11581158 value is the consequence of a test). The value is either 0 or 1. The
1159−actual CPU flags used is indicated in @code{SValue.c.i}.
1159+actual CPU flags used is indicated in @code{SValue.c.i}.
11601160
11611161 If any code is generated which destroys the CPU flags, this value MUST be
11621162 put in a normal register.
@@ -1176,7 +1176,7 @@ taken. · 13 unmodified lines
11761176 @item VT_LVAL
11771177 is a flag indicating that the value is actually an lvalue (left value of
11781178 an assignment). It means that the value stored is actually a pointer to
1179−the wanted value.
1179+the wanted value.
11801180
11811181 Understanding the use @code{VT_LVAL} is very important if you want to
11821182 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
tcc.h+4−4
@@ -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
@@ -605,7 +605,7 @@ struct TCCState { · 598 unmodified lines
605605 int old_struct_init_code; /* use old algorithm to init array in struct when there is no '{' used.
606606 Liuux 2.4.26 can't find initrd when compiled with a new algorithm */
607607 int dollars_in_identifiers; /* allows '$' char in indentifiers */
608−
608+
609609 /* warning switches */
610610 int warn_write_strings;
611611 int warn_unsupported;
@@ -631,7 +631,7 @@ struct TCCState { · 19 unmodified lines
631631
632632 char *init_symbol; /* symbols to call at load-time (not used currently) */
633633 char *fini_symbol; /* symbols to call at unload-time (not used currently) */
634−
634+
635635 #ifdef TCC_TARGET_I386
636636 int seg_size; /* 32. Can be 16 with i386 assembler (.code16) */
637637 #endif
@@ -885,7 +885,7 @@ struct TCCState { · 247 unmodified lines
885885
886886 #define TOK_SHL 0x01 /* shift left */
887887 #define TOK_SAR 0x02 /* signed shift right */
888−
888+
889889 /* assignement operators : normal operator or 0x80 */
890890 #define TOK_A_MOD 0xa5
891891 #define TOK_A_AND 0xa6
tccasm.c+25−25
@@ -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
@@ -125,7 +125,7 @@ static void asm_expr_unary(TCCState *s1, ExprValue *pe) · 118 unmodified lines
125125 break;
126126 }
127127 }
128−
128+
129129 static void asm_expr_prod(TCCState *s1, ExprValue *pe)
130130 {
131131 int op;
@@ -134,7 +134,7 @@ static void asm_expr_prod(TCCState *s1, ExprValue *pe) · 2 unmodified lines
134134 asm_expr_unary(s1, pe);
135135 for(;;) {
136136 op = tok;
137− if (op != '*' && op != '/' && op != '%' &&
137+ if (op != '*' && op != '/' && op != '%' &&
138138 op != TOK_SHL && op != TOK_SAR)
139139 break;
140140 next();
@@ -145,14 +145,14 @@ static void asm_expr_prod(TCCState *s1, ExprValue *pe) · 4 unmodified lines
145145 case '*':
146146 pe->v *= e2.v;
147147 break;
148− case '/':
148+ case '/':
149149 if (e2.v == 0) {
150150 div_error:
151151 tcc_error("division by zero");
152152 }
153153 pe->v /= e2.v;
154154 break;
155− case '%':
155+ case '%':
156156 if (e2.v == 0)
157157 goto div_error;
158158 pe->v %= e2.v;
@@ -186,7 +186,7 @@ static void asm_expr_logic(TCCState *s1, ExprValue *pe) · 27 unmodified lines
186186 case '&':
187187 pe->v &= e2.v;
188188 break;
189− case '|':
189+ case '|':
190190 pe->v |= e2.v;
191191 break;
192192 default:
@@ -224,7 +224,7 @@ static inline void asm_expr_sum(TCCState *s1, ExprValue *pe) · 31 unmodified lines
224224 } else if (pe->sym && !e2.sym) {
225225 /* OK */
226226 } else if (pe->sym && e2.sym) {
227− if (pe->sym == e2.sym) {
227+ if (pe->sym == e2.sym) {
228228 /* OK */
229229 } else if (pe->sym->r == e2.sym->r && pe->sym->r != 0) {
230230 /* we also accept defined symbols in the same section */
@@ -267,7 +267,7 @@ static void asm_new_label1(TCCState *s1, int label, int is_local, · 36 unmodified lines
267267 if (sym->r) {
268268 /* the label is already defined */
269269 if (!is_local) {
270− tcc_error("assembler label '%s' already defined",
270+ tcc_error("assembler label '%s' already defined",
271271 get_tok_str(label, NULL));
272272 } else {
273273 /* redefinition of local labels is possible */
@@ -493,7 +493,7 @@ static void asm_parse_directive(TCCState *s1) · 219 unmodified lines
493493 case TOK_ASM_weak:
494494 case TOK_ASM_hidden:
495495 tok1 = tok;
496− do {
496+ do {
497497 Sym *sym;
498498
499499 next();
@@ -541,7 +541,7 @@ static void asm_parse_directive(TCCState *s1) · 41 unmodified lines
541541 case TOK_ASM_text:
542542 case TOK_ASM_data:
543543 case TOK_ASM_bss:
544− {
544+ {
545545 char sname[64];
546546 tok1 = tok;
547547 n = 0;
@@ -591,7 +591,7 @@ static void asm_parse_directive(TCCState *s1) · 43 unmodified lines
591591 }
592592 break;
593593 case TOK_ASM_size:
594− {
594+ {
595595 Sym *sym;
596596
597597 next();
@@ -612,7 +612,7 @@ static void asm_parse_directive(TCCState *s1) · 14 unmodified lines
612612 }
613613 break;
614614 case TOK_ASM_type:
615− {
615+ {
616616 Sym *sym;
617617 const char *newtype;
618618
@@ -637,7 +637,7 @@ static void asm_parse_directive(TCCState *s1) · 18 unmodified lines
637637 sym->type.t = (sym->type.t & ~VT_BTYPE) | VT_FUNC;
638638 }
639639 else if (s1->warn_unsupported)
640− tcc_warning("change type of '%s' from 0x%x to '%s' ignored",
640+ tcc_warning("change type of '%s' from 0x%x to '%s' ignored",
641641 get_tok_str(sym->v, NULL), sym->type.t, newtype);
642642
643643 next();
@@ -669,7 +669,7 @@ static void asm_parse_directive(TCCState *s1) · 25 unmodified lines
669669 }
670670 break;
671671 case TOK_ASM_previous:
672− {
672+ {
673673 Section *sec;
674674 next();
675675 if (!last_text_section)
@@ -830,7 +830,7 @@ ST_FUNC int tcc_assemble(TCCState *s1, int do_preprocess) · 154 unmodified lines
830830
831831 cur_text_section->data_offset = ind;
832832
833− free_defines(define_start);
833+ free_defines(define_start);
834834
835835 return ret;
836836 }
@@ -863,7 +863,7 @@ static void tcc_assemble_inline(TCCState *s1, char *str, int len) · 26 unmodified lines
863863 /* find a constraint by its number or id (gcc 3 extended
864864 syntax). return -1 if not found. Return in *pp in char after the
865865 constraint */
866−ST_FUNC int find_constraint(ASMOperand *operands, int nb_operands,
866+ST_FUNC int find_constraint(ASMOperand *operands, int nb_operands,
867867 const char *name, const char **pp)
868868 {
869869 int index;
@@ -901,7 +901,7 @@ ST_FUNC int find_constraint(ASMOperand *operands, int nb_operands, · 31 unmodified lines
901901 return index;
902902 }
903903
904−static void subst_asm_operands(ASMOperand *operands, int nb_operands,
904+static void subst_asm_operands(ASMOperand *operands, int nb_operands,
905905 int nb_outputs,
906906 CString *out_str, CString *in_str)
907907 {
@@ -1052,12 +1052,12 @@ ST_FUNC void asm_instr(void) · 144 unmodified lines
10521052 token after the assembler parsing */
10531053 if (tok != ';')
10541054 expect("';'");
1055−
1055+
10561056 /* save all values in the memory */
10571057 save_regs(0);
10581058
10591059 /* compute constraints */
1060− asm_compute_constraints(operands, nb_operands, nb_outputs,
1060+ asm_compute_constraints(operands, nb_operands, nb_outputs,
10611061 clobber_regs, &out_reg);
10621062
10631063 /* substitute the operands in the asm string. No substitution is
@@ -1076,8 +1076,8 @@ ST_FUNC void asm_instr(void) · 12 unmodified lines
10761076 #endif
10771077
10781078 /* generate loads */
1079− asm_gen_code(operands, nb_operands, nb_outputs, 0,
1080− clobber_regs, out_reg);
1079+ asm_gen_code(operands, nb_operands, nb_outputs, 0,
1080+ clobber_regs, out_reg);
10811081
10821082 /* assemble the string with tcc internal assembler */
10831083 tcc_assemble_inline(tcc_state, astr1.data, astr1.size - 1);
@@ -1086,9 +1086,9 @@ ST_FUNC void asm_instr(void) · 2 unmodified lines
10861086 next();
10871087
10881088 /* store the output values if needed */
1089− asm_gen_code(operands, nb_operands, nb_outputs, 1,
1089+ asm_gen_code(operands, nb_operands, nb_outputs, 1,
10901090 clobber_regs, out_reg);
1091−
1091+
10921092 /* free everything */
10931093 for(i=0;i<nb_operands;i++) {
10941094 ASMOperand *op;
@@ -1110,7 +1110,7 @@ ST_FUNC void asm_global_instr(void) · 15 unmodified lines
11101110 token after the assembler parsing */
11111111 if (tok != ';')
11121112 expect("';'");
1113−
1113+
11141114 #ifdef ASM_DEBUG
11151115 printf("asm_global: \"%s\"\n", (char *)astr.data);
11161116 #endif
@@ -1119,7 +1119,7 @@ ST_FUNC void asm_global_instr(void) · 2 unmodified lines
11191119
11201120 /* assemble the string with tcc internal assembler */
11211121 tcc_assemble_inline(tcc_state, astr.data, astr.size - 1);
1122−
1122+
11231123 cur_text_section->data_offset = ind;
11241124
11251125 /* 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 *
@@ -606,7 +606,7 @@ ST_FUNC int tcc_output_coff(TCCState *s1, FILE *f) · 599 unmodified lines
606606 // put a .ef
607607
608608 strcpy(csym._n._n_name, ".ef");
609− csym.n_value = EndAddress[k]; // physical address
609+ csym.n_value = EndAddress[k]; // physical address
610610 csym.n_scnum = CoffTextSectionNo;
611611 csym.n_type = 0;
612612 csym.n_sclass = C_FCN;
tccelf.c+1−1
@@ -1179,7 +1179,7 @@ static unsigned long put_got_entry(TCCState *s1, · 1178 unmodified lines
11791179 p[11] = 0xe9; /* jmp plt_start */
11801180 put32(p + 12, -(plt->data_offset));
11811181
1182− /* If this was an UNDEF symbol set the offset in the
1182+ /* If this was an UNDEF symbol set the offset in the
11831183 dynsymtab to the PLT slot, so that PC32 relocs to it
11841184 can be resolved. */
11851185 if (sym->st_shndx == SHN_UNDEF)
tccgen.c+110−110
@@ -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
@@ -299,7 +299,7 @@ static void weaken_symbol(Sym *sym) · 292 unmodified lines
299299 if (sym->c > 0) {
300300 int esym_type;
301301 ElfW(Sym) *esym;
302−
302+
303303 esym = &((ElfW(Sym) *)symtab_section->data)[sym->c];
304304 esym_type = ELFW(ST_TYPE)(esym->st_info);
305305 esym->st_info = ELFW(ST_INFO)(STB_WEAK, esym_type);
@@ -321,7 +321,7 @@ static void apply_visibility(Sym *sym, CType *type) · 15 unmodified lines
321321
322322 if (sym->c > 0) {
323323 ElfW(Sym) *esym;
324−
324+
325325 esym = &((ElfW(Sym) *)symtab_section->data)[sym->c];
326326 vis >>= VT_VIS_SHIFT;
327327 esym->st_other = (esym->st_other & ~ELFW(ST_VISIBILITY)(-1)) | vis;
@@ -425,7 +425,7 @@ ST_FUNC Sym *get_sym_ref(CType *type, Section *sec, unsigned long offset, unsign · 97 unmodified lines
425425 /* push a reference to a section offset by adding a dummy symbol */
426426 static void vpush_ref(CType *type, Section *sec, unsigned long offset, unsigned long size)
427427 {
428− vpushsym(type, get_sym_ref(type, sec, offset, size));
428+ vpushsym(type, get_sym_ref(type, sec, offset, size));
429429 }
430430
431431 /* define a new external reference to a symbol 'v' of type 'u' */
@@ -461,7 +461,7 @@ static Sym *external_sym(int v, CType *type, int r, char *asm_label) · 29 unmodified lines
461461 s->r = r | VT_CONST | VT_SYM;
462462 s->type.t |= VT_EXTERN;
463463 } else if (!is_compatible_types(&s->type, type)) {
464− tcc_error("incompatible types for redefinition of '%s'",
464+ tcc_error("incompatible types for redefinition of '%s'",
465465 get_tok_str(v, NULL));
466466 }
467467 /* Merge some storage attributes. */
@@ -600,7 +600,7 @@ ST_FUNC int get_reg_ex(int rc, int rc2) · 132 unmodified lines
600600 {
601601 int r;
602602 SValue *p;
603−
603+
604604 for(r=0;r<NB_REGS;r++) {
605605 if (reg_classes[r] & rc2) {
606606 int n;
@@ -636,7 +636,7 @@ ST_FUNC int get_reg(int rc) · 29 unmodified lines
636636 }
637637 notfound: ;
638638 }
639−
639+
640640 /* no register left : free the first one on the stack (VERY
641641 IMPORTANT to start from the bottom to ensure that we don't
642642 spill registers used in gen_opi()) */
@@ -761,7 +761,7 @@ ST_FUNC int gv(int rc) · 118 unmodified lines
761761 gen_op(TOK_SAR);
762762 r = gv(rc);
763763 } else {
764− if (is_float(vtop->type.t) &&
764+ if (is_float(vtop->type.t) &&
765765 (vtop->r & (VT_VALMASK | VT_LVAL)) == VT_CONST) {
766766 Sym *sym;
767767 int *ptr;
@@ -769,7 +769,7 @@ ST_FUNC int gv(int rc) · 1 unmodified line
769769 #if defined(TCC_TARGET_ARM) && !defined(TCC_ARM_VFP)
770770 CValue check;
771771 #endif
772−
772+
773773 /* XXX: unify with initializers handling ? */
774774 /* CPUs usually cannot use float constants, so we store them
775775 generically in data segment */
@@ -803,7 +803,7 @@ ST_FUNC int gv(int rc) · 27 unmodified lines
803803 vtop->c.ptr_offset = 0;
804804 }
805805 #ifdef CONFIG_TCC_BCHECK
806− if (vtop->r & VT_MUSTBOUND)
806+ if (vtop->r & VT_MUSTBOUND)
807807 gbound();
808808 #endif
809809
@@ -921,7 +921,7 @@ ST_FUNC int gv(int rc) · 111 unmodified lines
921921 vtop->r = r;
922922 #ifdef TCC_TARGET_C67
923923 /* uses register pairs for doubles */
924− if ((vtop->type.t & VT_BTYPE) == VT_DOUBLE)
924+ if ((vtop->type.t & VT_BTYPE) == VT_DOUBLE)
925925 vtop->r2 = r+1;
926926 #endif
927927 }
@@ -1036,7 +1036,7 @@ static void lbuild(int t) · 108 unmodified lines
10361036 vpop();
10371037 }
10381038
1039−/* rotate n first stack elements to the bottom
1039+/* rotate n first stack elements to the bottom
10401040 I1 ... In -> I2 ... In I1 [top is right]
10411041 */
10421042 ST_FUNC void vrotb(int n)
@@ -1476,7 +1476,7 @@ static void gen_opic(int op) · 433 unmodified lines
14761476 vtop--;
14771477 } else {
14781478 /* if commutative ops, put c2 as constant */
1479− if (c1 && (op == '+' || op == '&' || op == '^' ||
1479+ if (c1 && (op == '+' || op == '&' || op == '^' ||
14801480 op == '|' || op == '*')) {
14811481 vswap();
14821482 c2 = c1; //c = c1, c1 = c2, c2 = c;
@@ -1582,13 +1582,13 @@ static void gen_opif(int op) · 99 unmodified lines
15821582 case '+': f1 += f2; break;
15831583 case '-': f1 -= f2; break;
15841584 case '*': f1 *= f2; break;
1585− case '/':
1585+ case '/':
15861586 if (f2 == 0.0) {
15871587 if (const_wanted)
15881588 tcc_error("division by zero in constant");
15891589 goto general_case;
15901590 }
1591− f1 /= f2;
1591+ f1 /= f2;
15921592 break;
15931593 /* XXX: also handles tests ? */
15941594 default:
@@ -1636,7 +1636,7 @@ static inline int is_null_pointer(SValue *p) · 41 unmodified lines
16361636
16371637 static inline int is_integer_btype(int bt)
16381638 {
1639− return (bt == VT_BYTE || bt == VT_SHORT ||
1639+ return (bt == VT_BYTE || bt == VT_SHORT ||
16401640 bt == VT_INT || bt == VT_LLONG);
16411641 }
16421642
@@ -1645,7 +1645,7 @@ static void check_comparison_pointer_types(SValue *p1, SValue *p2, int op) · 2 unmodified lines
16451645 {
16461646 CType *type1, *type2, tmp_type1, tmp_type2;
16471647 int bt1, bt2;
1648−
1648+
16491649 /* null pointers are accepted for all comparisons as gcc */
16501650 if (is_null_pointer(p1) || is_null_pointer(p2))
16511651 return;
@@ -1663,16 +1663,16 @@ static void check_comparison_pointer_types(SValue *p1, SValue *p2, int op) · 11 unmodified lines
16631663 /* both must be pointers or implicit function pointers */
16641664 if (bt1 == VT_PTR) {
16651665 type1 = pointed_type(type1);
1666− } else if (bt1 != VT_FUNC)
1666+ } else if (bt1 != VT_FUNC)
16671667 goto invalid_operands;
16681668
16691669 if (bt2 == VT_PTR) {
16701670 type2 = pointed_type(type2);
1671− } else if (bt2 != VT_FUNC) {
1671+ } else if (bt2 != VT_FUNC) {
16721672 invalid_operands:
16731673 tcc_error("invalid operands to binary %s", get_tok_str(op, NULL));
16741674 }
1675− if ((type1->t & VT_BTYPE) == VT_VOID ||
1675+ if ((type1->t & VT_BTYPE) == VT_VOID ||
16761676 (type2->t & VT_BTYPE) == VT_VOID)
16771677 return;
16781678 tmp_type1 = *type1;
@@ -1698,7 +1698,7 @@ ST_FUNC void gen_op(int op) · 19 unmodified lines
16981698 t2 = vtop[0].type.t;
16991699 bt1 = t1 & VT_BTYPE;
17001700 bt2 = t2 & VT_BTYPE;
1701−
1701+
17021702 if (bt1 == VT_PTR || bt2 == VT_PTR) {
17031703 /* at least one operand is a pointer */
17041704 /* relationnal op: must be both pointers */
@@ -1729,7 +1729,7 @@ ST_FUNC void gen_op(int op) · 24 unmodified lines
17291729 #if defined(TCC_TARGET_ARM64) || defined(TCC_TARGET_X86_64)
17301730 vtop->type.t = VT_LLONG;
17311731 #else
1732− vtop->type.t = VT_INT;
1732+ vtop->type.t = VT_INT;
17331733 #endif
17341734 vswap();
17351735 gen_op(TOK_PDIV);
@@ -1770,7 +1770,7 @@ ST_FUNC void gen_op(int op) · 34 unmodified lines
17701770 fprintf(stderr, "v+i-j = %p\n", v+i-j);
17711771 fprintf(stderr, "v+(i-j) = %p\n", v+(i-j));
17721772 }
1773− When this code is on. then the output looks like
1773+ When this code is on. then the output looks like
17741774 v+i-j = 0xfffffffe
17751775 v+(i-j) = 0xbff84000
17761776 */
@@ -1880,7 +1880,7 @@ static void gen_cvt_itof1(int t) · 103 unmodified lines
18801880 #ifdef TCC_TARGET_ARM64
18811881 gen_cvt_itof(t);
18821882 #else
1883− if ((vtop->type.t & (VT_BTYPE | VT_UNSIGNED)) ==
1883+ if ((vtop->type.t & (VT_BTYPE | VT_UNSIGNED)) ==
18841884 (VT_LLONG | VT_UNSIGNED)) {
18851885
18861886 if (t == VT_FLOAT)
@@ -2127,7 +2127,7 @@ static void gen_cast(CType *type) · 240 unmodified lines
21272127 /* scalar to bool */
21282128 vpushi(0);
21292129 gen_op(TOK_NE);
2130− } else if ((dbt & VT_BTYPE) == VT_BYTE ||
2130+ } else if ((dbt & VT_BTYPE) == VT_BYTE ||
21312131 (dbt & VT_BTYPE) == VT_SHORT) {
21322132 if (sbt == VT_PTR) {
21332133 vtop->type.t = VT_INT;
@@ -2140,7 +2140,7 @@ static void gen_cast(CType *type) · 6 unmodified lines
21402140 /* from long long: just take low order word */
21412141 lexpand();
21422142 vpop();
2143− }
2143+ }
21442144 /* if lvalue and single word type, nothing to do because
21452145 the lvalue already contains the real type size (see
21462146 VT_LVAL_xxx constants) */
@@ -2194,7 +2194,7 @@ ST_FUNC int type_size(CType *type, int *a) · 47 unmodified lines
21942194 #endif
21952195 #elif defined(TCC_TARGET_ARM)
21962196 #ifdef TCC_ARM_EABI
2197− *a = 8;
2197+ *a = 8;
21982198 #else
21992199 *a = 4;
22002200 #endif
@@ -2289,7 +2289,7 @@ static int is_compatible_func(CType *type1, CType *type2) · 88 unmodified lines
22892289 /* return true if type1 and type2 are the same. If unqualified is
22902290 true, qualifiers on the types are ignored.
22912291
2292− - enums are not checked as gcc __builtin_types_compatible_p ()
2292+ - enums are not checked as gcc __builtin_types_compatible_p ()
22932293 */
22942294 static int compare_types(CType *type1, CType *type2, int unqualified)
22952295 {
@@ -2326,7 +2326,7 @@ static int compare_types(CType *type1, CType *type2, int unqualified) · 30 unmodified lines
23262326 }
23272327
23282328 /* return true if type1 and type2 are exactly the same (including
2329− qualifiers).
2329+ qualifiers).
23302330 */
23312331 static int is_compatible_types(CType *type1, CType *type2)
23322332 {
@@ -2344,7 +2344,7 @@ static int is_compatible_parameter_types(CType *type1, CType *type2) · 11 unmodified lines
23442344 printed in the type */
23452345 /* XXX: union */
23462346 /* XXX: add array and function pointers */
2347−static void type_to_str(char *buf, int buf_size,
2347+static void type_to_str(char *buf, int buf_size,
23482348 CType *type, const char *varstr)
23492349 {
23502350 int bt, v, t;
@@ -2487,7 +2487,7 @@ static void gen_assign_cast(CType *dt) · 136 unmodified lines
24872487 if (sbt != VT_PTR)
24882488 goto error;
24892489 type2 = pointed_type(st);
2490− if ((type1->t & VT_BTYPE) == VT_VOID ||
2490+ if ((type1->t & VT_BTYPE) == VT_VOID ||
24912491 (type2->t & VT_BTYPE) == VT_VOID) {
24922492 /* void * can match anything */
24932493 } else {
@@ -2716,7 +2716,7 @@ ST_FUNC void inc(int post, int c) · 222 unmodified lines
27162716 vrotb(3);
27172717 }
27182718 /* add constant */
2719− vpushi(c - TOK_MID);
2719+ vpushi(c - TOK_MID);
27202720 gen_op('+');
27212721 vstore(); /* store value */
27222722 if (post)
@@ -2734,7 +2734,7 @@ ST_FUNC void inc(int post, int c) · 11 unmodified lines
27342734 static void parse_attribute(AttributeDef *ad)
27352735 {
27362736 int t, n;
2737−
2737+
27382738 while (tok == TOK_ATTRIBUTE1 || tok == TOK_ATTRIBUTE2) {
27392739 next();
27402740 skip('(');
@@ -2787,7 +2787,7 @@ static void parse_attribute(AttributeDef *ad) · 46 unmodified lines
27872787 if (tok == '(') {
27882788 next();
27892789 n = expr_const();
2790− if (n <= 0 || (n & (n - 1)) != 0)
2790+ if (n <= 0 || (n & (n - 1)) != 0)
27912791 tcc_error("alignment must be a positive power of two");
27922792 skip(')');
27932793 } else {
@@ -2828,7 +2828,7 @@ static void parse_attribute(AttributeDef *ad) · 34 unmodified lines
28282828 case TOK_REGPARM2:
28292829 skip('(');
28302830 n = expr_const();
2831− if (n > 3)
2831+ if (n > 3)
28322832 n = 3;
28332833 else if (n < 0)
28342834 n = 0;
@@ -2840,7 +2840,7 @@ static void parse_attribute(AttributeDef *ad) · 5 unmodified lines
28402840 case TOK_FASTCALL2:
28412841 case TOK_FASTCALL3:
28422842 ad->a.func_call = FUNC_FASTCALLW;
2843− break;
2843+ break;
28442844 #endif
28452845 case TOK_MODE:
28462846 skip('(');
@@ -2874,9 +2874,9 @@ static void parse_attribute(AttributeDef *ad) · 27 unmodified lines
28742874 if (tok == '(') {
28752875 int parenthesis = 0;
28762876 do {
2877− if (tok == '(')
2877+ if (tok == '(')
28782878 parenthesis++;
2879− else if (tok == ')')
2879+ else if (tok == ')')
28802880 parenthesis--;
28812881 next();
28822882 } while (parenthesis && tok != -1);
@@ -2928,7 +2928,7 @@ static void struct_decl(CType *type, int u, int tdef) · 45 unmodified lines
29282928 do_decl:
29292929 type->t = u;
29302930 type->ref = s;
2931−
2931+
29322932 if (tok == '{') {
29332933 next();
29342934 if (s->c != -1)
@@ -3001,7 +3001,7 @@ static void struct_decl(CType *type, int u, int tdef) · 66 unmodified lines
30013001 }
30023002 if ((type1.t & VT_BTYPE) == VT_FUNC ||
30033003 (type1.t & (VT_TYPEDEF | VT_STATIC | VT_EXTERN | VT_INLINE)))
3004− tcc_error("invalid type for '%s'",
3004+ tcc_error("invalid type for '%s'",
30053005 get_tok_str(v, NULL));
30063006 }
30073007 if (tok == ':') {
@@ -3009,10 +3009,10 @@ static void struct_decl(CType *type, int u, int tdef) · 1 unmodified line
30093009 bit_size = expr_const();
30103010 /* XXX: handle v = 0 case for messages */
30113011 if (bit_size < 0)
3012− tcc_error("negative width in bit-field '%s'",
3012+ tcc_error("negative width in bit-field '%s'",
30133013 get_tok_str(v, NULL));
30143014 if (v && bit_size == 0)
3015− tcc_error("zero width for bit-field '%s'",
3015+ tcc_error("zero width for bit-field '%s'",
30163016 get_tok_str(v, NULL));
30173017 }
30183018 size = type_size(&type1, &align);
@@ -3028,8 +3028,8 @@ static void struct_decl(CType *type, int u, int tdef) · 9 unmodified lines
30283028 lbit_pos = 0;
30293029 if (bit_size >= 0) {
30303030 bt = type1.t & VT_BTYPE;
3031− if (bt != VT_INT &&
3032− bt != VT_BYTE &&
3031+ if (bt != VT_INT &&
3032+ bt != VT_BYTE &&
30333033 bt != VT_SHORT &&
30343034 bt != VT_BOOL &&
30353035 bt != VT_ENUM &&
@@ -3056,7 +3056,7 @@ static void struct_decl(CType *type, int u, int tdef) · 20 unmodified lines
30563056 bit_pos = 0;
30573057 lbit_pos = bit_pos;
30583058 /* XXX: handle LSB first */
3059− type1.t |= VT_BITFIELD |
3059+ type1.t |= VT_BITFIELD |
30603060 (bit_pos << VT_STRUCT_SHIFT) |
30613061 (bit_size << (VT_STRUCT_SHIFT + 6));
30623062 bit_pos += bit_size;
@@ -3083,10 +3083,10 @@ static void struct_decl(CType *type, int u, int tdef) · 20 unmodified lines
30833083 maxalign = align;
30843084 }
30853085 #if 0
3086− printf("add field %s offset=%d",
3086+ printf("add field %s offset=%d",
30873087 get_tok_str(v, NULL), offset);
30883088 if (type1.t & VT_BITFIELD) {
3089− printf(" pos=%d size=%d",
3089+ printf(" pos=%d size=%d",
30903090 (type1.t >> VT_STRUCT_SHIFT) & 0x3f,
30913091 (type1.t >> (VT_STRUCT_SHIFT + 6)) & 0x3f);
30923092 }
@@ -3113,7 +3113,7 @@ static void struct_decl(CType *type, int u, int tdef) · 20 unmodified lines
31133113 }
31143114 skip('}');
31153115 /* store size and alignment */
3116− s->c = (c + maxalign - 1) & -maxalign;
3116+ s->c = (c + maxalign - 1) & -maxalign;
31173117 s->r = maxalign;
31183118 }
31193119 }
@@ -3126,7 +3126,7 @@ ST_FUNC int is_btype_size(int bt) · 6 unmodified lines
31263126 }
31273127
31283128 /* return 0 if no type declaration. otherwise, return the basic type
3129− and skip it.
3129+ and skip it.
31303130 */
31313131 static int parse_btype(CType *type, AttributeDef *ad)
31323132 {
@@ -3436,9 +3436,9 @@ static void post_type(CType *type, AttributeDef *ad) · 303 unmodified lines
34363436 skip(')');
34373437 /* NOTE: const is ignored in returned type as it has a special
34383438 meaning in gcc / C++ */
3439− type->t &= ~VT_CONSTANT;
3439+ type->t &= ~VT_CONSTANT;
34403440 /* some ancient pre-K&R C allows a function to return an array
3441− and the array brackets to be put after the arguments, such
3441+ and the array brackets to be put after the arguments, such
34423442 that "int c()[]" means something like "int[] c()" */
34433443 if (tok == '[') {
34443444 next();
@@ -3479,7 +3479,7 @@ static void post_type(CType *type, AttributeDef *ad) · 34 unmodified lines
34793479 if (type->t == VT_FUNC)
34803480 tcc_error("declaration of an array of functions");
34813481 t1 |= type->t & VT_VLA;
3482−
3482+
34833483 if (t1 & VT_VLA) {
34843484 loc -= type_size(&int_type, &align);
34853485 loc &= -align;
@@ -3493,7 +3493,7 @@ static void post_type(CType *type, AttributeDef *ad) · 7 unmodified lines
34933493 }
34943494 if (n != -1)
34953495 vpop();
3496−
3496+
34973497 /* we push an anonymous symbol which will contain the array
34983498 element type */
34993499 s = sym_push(SYM_FIELD, type, 0, n);
@@ -3506,7 +3506,7 @@ static void post_type(CType *type, AttributeDef *ad) · 6 unmodified lines
35063506 in 'type'. 'td' is a bitmask indicating which kind of type decl is
35073507 expected. 'type' should contain the basic type. 'ad' is the
35083508 attribute definition of the basic type. It can be modified by
3509− type_decl().
3509+ type_decl().
35103510 */
35113511 static void type_decl(CType *type, AttributeDef *ad, int *v, int td)
35123512 {
@@ -3537,7 +3537,7 @@ static void type_decl(CType *type, AttributeDef *ad, int *v, int td) · 24 unmodified lines
35373537 mk_pointer(type);
35383538 type->t |= qualifiers;
35393539 }
3540−
3540+
35413541 /* XXX: clarify attribute handling */
35423542 if (tok == TOK_ATTRIBUTE1 || tok == TOK_ATTRIBUTE2)
35433543 parse_attribute(ad);
@@ -3576,7 +3576,7 @@ static void type_decl(CType *type, AttributeDef *ad, int *v, int td) · 32 unmodified lines
35763576 type->t |= storage;
35773577 if (tok == TOK_ATTRIBUTE1 || tok == TOK_ATTRIBUTE2)
35783578 parse_attribute(ad);
3579−
3579+
35803580 if (!type1.t)
35813581 return;
35823582 /* append type at the end of type1 */
@@ -3711,7 +3711,7 @@ ST_FUNC void unary(void) · 128 unmodified lines
37113711 next();
37123712 goto tok_next;
37133713 case TOK_CINT:
3714− case TOK_CCHAR:
3714+ case TOK_CCHAR:
37153715 case TOK_LCHAR:
37163716 vpushi(tokc.i);
37173717 next();
@@ -3814,7 +3814,7 @@ ST_FUNC void unary(void) · 96 unmodified lines
38143814 linux/include/net/tcp.h:945: error: statement expression in global scope */
38153815
38163816 /* save all registers */
3817− save_regs(0);
3817+ save_regs(0);
38183818 /* statement expression : we do not accept break/continue
38193819 inside as GCC does */
38203820 block(NULL, NULL, NULL, NULL, 0, 1);
@@ -4087,7 +4087,7 @@ ST_FUNC void unary(void) · 266 unmodified lines
40874087 vpushsym(&s->type, s);
40884088 next();
40894089 break;
4090−
4090+
40914091 // special qnan , snan and infinity values
40924092 case TOK___NAN__:
40934093 vpush64(VT_DOUBLE, 0x7ff8000000000000ULL);
@@ -4123,7 +4123,7 @@ ST_FUNC void unary(void) · 29 unmodified lines
41234123 #endif
41244124 )
41254125 tcc_warning("implicit declaration of function '%s'", name);
4126− s = external_global_sym(t, &func_old_type, 0);
4126+ s = external_global_sym(t, &func_old_type, 0);
41274127 }
41284128 if ((s->type.t & (VT_STATIC | VT_INLINE | VT_BTYPE)) ==
41294129 (VT_STATIC | VT_INLINE | VT_FUNC)) {
@@ -4146,7 +4146,7 @@ ST_FUNC void unary(void) · 16 unmodified lines
41464146 }
41474147 break;
41484148 }
4149−
4149+
41504150 /* post operations */
41514151 while (1) {
41524152 if (tok == TOK_INC || tok == TOK_DEC) {
@@ -4154,8 +4154,8 @@ ST_FUNC void unary(void) · 1 unmodified line
41544154 next();
41554155 } else if (tok == '.' || tok == TOK_ARROW) {
41564156 int qualifiers;
4157− /* field */
4158− if (tok == TOK_ARROW)
4157+ /* field */
4158+ if (tok == TOK_ARROW)
41594159 indir();
41604160 qualifiers = vtop->type.t & (VT_CONSTANT | VT_VOLATILE);
41614161 test_lvalue();
@@ -4637,7 +4637,7 @@ static void expr_cond(void) · 475 unmodified lines
46374637 (t2 & (VT_BTYPE | VT_UNSIGNED)) == (VT_INT | VT_UNSIGNED))
46384638 type.t |= VT_UNSIGNED;
46394639 }
4640−
4640+
46414641 /* now we convert second operand */
46424642 gen_cast(&type);
46434643 if (VT_STRUCT == (vtop->type.t & VT_BTYPE))
@@ -4653,9 +4653,9 @@ static void expr_cond(void) · 9 unmodified lines
46534653 } else if ((type.t & VT_BTYPE) == VT_LLONG) {
46544654 /* for long longs, we use fixed registers to avoid having
46554655 to handle a complicated move */
4656− rc = RC_IRET;
4656+ rc = RC_IRET;
46574657 }
4658−
4658+
46594659 r2 = gv(rc);
46604660 /* this is horrible, but we must also convert first
46614661 operand */
@@ -4677,7 +4677,7 @@ static void expr_cond(void) · 15 unmodified lines
46774677 static void expr_eq(void)
46784678 {
46794679 int t;
4680−
4680+
46814681 expr_cond();
46824682 if (tok == '=' ||
46834683 (tok >= TOK_A_MOD && tok <= TOK_A_DIV) ||
@@ -4797,7 +4797,7 @@ static void label_or_decl(int l) · 113 unmodified lines
47974797 decl(l);
47984798 }
47994799
4800−static void block(int *bsym, int *csym, int *case_sym, int *def_sym,
4800+static void block(int *bsym, int *csym, int *case_sym, int *def_sym,
48014801 int case_reg, int is_expr)
48024802 {
48034803 int a, b, c, d;
@@ -4858,7 +4858,7 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, · 54 unmodified lines
48584858 frame_bottom->next = scope_stack_bottom;
48594859 scope_stack_bottom = frame_bottom;
48604860 llabel = local_label_stack;
4861−
4861+
48624862 /* handle local labels declarations */
48634863 if (tok == TOK_LABEL) {
48644864 next();
@@ -4906,14 +4906,14 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, · 41 unmodified lines
49064906 /* pop locally defined symbols */
49074907 scope_stack_bottom = scope_stack_bottom->next;
49084908 sym_pop(&local_stack, s);
4909−
4909+
49104910 /* Pop VLA frames and restore stack pointer if required */
49114911 if (vlas_in_scope > saved_vlas_in_scope) {
49124912 vla_sp_loc = saved_vlas_in_scope ? block_vla_sp_loc : vla_sp_root_loc;
49134913 vla_sp_restore();
49144914 }
49154915 vlas_in_scope = saved_vlas_in_scope;
4916−
4916+
49174917 next();
49184918 } else if (tok == TOK_RETURN) {
49194919 next();
@@ -5080,7 +5080,7 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, · 160 unmodified lines
50805080 gsym_addr(b, c);
50815081 scope_stack_bottom = scope_stack_bottom->next;
50825082 sym_pop(&local_stack, s);
5083− } else
5083+ } else
50845084 if (tok == TOK_DO) {
50855085 next();
50865086 a = 0;
@@ -5154,7 +5154,7 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, · 67 unmodified lines
51545154 skip(':');
51555155 is_expr = 0;
51565156 goto block_after_label;
5157− } else
5157+ } else
51585158 if (tok == TOK_DEFAULT) {
51595159 next();
51605160 skip(':');
@@ -5185,7 +5185,7 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, · 24 unmodified lines
51855185 s->r = LABEL_FORWARD;
51865186 }
51875187 vla_sp_restore_root();
5188− if (s->r & LABEL_FORWARD)
5188+ if (s->r & LABEL_FORWARD)
51895189 s->jnext = gjmp(s->jnext);
51905190 else
51915191 gjmp_addr(s->jnext);
@@ -5240,8 +5240,8 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, · 48 unmodified lines
52405240 address. cur_index/cur_field is the pointer to the current
52415241 value. 'size_only' is true if only size info is needed (only used
52425242 in arrays) */
5243−static void decl_designator(CType *type, Section *sec, unsigned long c,
5244− int *cur_index, Sym **cur_field,
5243+static void decl_designator(CType *type, Section *sec, unsigned long c,
5244+ int *cur_index, Sym **cur_field,
52455245 int size_only)
52465246 {
52475247 Sym *s, *f;
@@ -5265,7 +5265,7 @@ static void decl_designator(CType *type, Section *sec, unsigned long c, · 17 unmodified lines
52655265 if (tok == TOK_DOTS && gnu_ext) {
52665266 next();
52675267 index_last = expr_const();
5268− if (index_last < 0 ||
5268+ if (index_last < 0 ||
52695269 (s->c >= 0 && index_last >= s->c) ||
52705270 index_last < index)
52715271 expect("invalid index");
@@ -5361,7 +5361,7 @@ static void decl_designator(CType *type, Section *sec, unsigned long c, · 89 unmodified lines
53615361 #define EXPR_ANY 2
53625362
53635363 /* store a value or an expression directly in global data or in local array */
5364−static void init_putv(CType *type, Section *sec, unsigned long c,
5364+static void init_putv(CType *type, Section *sec, unsigned long c,
53655365 int v, int expr_type)
53665366 {
53675367 int saved_global_expr, bt, bit_pos, bit_size;
@@ -5387,7 +5387,7 @@ static void init_putv(CType *type, Section *sec, unsigned long c, · 19 unmodified lines
53875387 expr_eq();
53885388 break;
53895389 }
5390−
5390+
53915391 dtype = *type;
53925392 dtype.t &= ~VT_CONSTANT; /* need to do that to avoid false warning */
53935393
@@ -5502,7 +5502,7 @@ static void init_putz(CType *t, Section *sec, unsigned long c, int size) · 108 unmodified lines
55025502 allocation. 'first' is true if array '{' must be read (multi
55035503 dimension implicit array init handling). 'size_only' is true if
55045504 size only evaluation is wanted (only for arrays). */
5505−static void decl_initializer(CType *type, Section *sec, unsigned long c,
5505+static void decl_initializer(CType *type, Section *sec, unsigned long c,
55065506 int first, int size_only)
55075507 {
55085508 int index, array_length, n, no_oblock, nb, parlevel, parlevel1, i;
@@ -5512,14 +5512,14 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c, · 3 unmodified lines
55125512
55135513 if (type->t & VT_VLA) {
55145514 int a;
5515−
5515+
55165516 /* save current stack pointer */
55175517 if (vlas_in_scope == 0) {
55185518 if (vla_sp_root_loc == -1)
55195519 vla_sp_root_loc = (loc -= PTR_SIZE);
55205520 gen_vla_sp_save(vla_sp_root_loc);
55215521 }
5522−
5522+
55235523 vla_runtime_type_size(type, &a);
55245524 gen_vla_alloc(type, a);
55255525 gen_vla_sp_save(c);
@@ -5533,7 +5533,7 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c, · 7 unmodified lines
55335533 size1 = type_size(t1, &align1);
55345534
55355535 no_oblock = 1;
5536− if ((first && tok != TOK_LSTR && tok != TOK_STR) ||
5536+ if ((first && tok != TOK_LSTR && tok != TOK_STR) ||
55375537 tok == '{') {
55385538 if (tok != '{')
55395539 tcc_error("character array initializer must be a literal,"
@@ -5544,7 +5544,7 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c, · 4 unmodified lines
55445544
55455545 /* only parse strings here if correct type (otherwise: handle
55465546 them as ((w)char *) expressions */
5547− if ((tok == TOK_LSTR &&
5547+ if ((tok == TOK_LSTR &&
55485548 #ifdef TCC_TARGET_PE
55495549 (t1->t & VT_BTYPE) == VT_SHORT && (t1->t & VT_UNSIGNED)
55505550 #else
@@ -5604,7 +5604,7 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c, · 53 unmodified lines
56045604 /* must put zero in holes (note that doing it that way
56055605 ensures that it even works with designators) */
56065606 if (!size_only && array_length < index) {
5607− init_putz(t1, sec, c + array_length * size1,
5607+ init_putz(t1, sec, c + array_length * size1,
56085608 (index - array_length) * size1);
56095609 }
56105610 index++;
@@ -5624,7 +5624,7 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c, · 13 unmodified lines
56245624 skip('}');
56255625 /* put zeros at the end */
56265626 if (!size_only && n >= 0 && array_length < n) {
5627− init_putz(t1, sec, c + array_length * size1,
5627+ init_putz(t1, sec, c + array_length * size1,
56285628 (n - array_length) * size1);
56295629 }
56305630 /* patch type size if needed */
@@ -5690,7 +5690,7 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c, · 59 unmodified lines
56905690 decl_designator(type, sec, c, NULL, &f, size_only);
56915691 index = f->c;
56925692 if (!size_only && array_length < index) {
5693− init_putz(type, sec, c + array_length,
5693+ init_putz(type, sec, c + array_length,
56945694 index - array_length);
56955695 }
56965696 index = index + type_size(&f->type, &align1);
@@ -5743,7 +5743,7 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c, · 46 unmodified lines
57435743 }
57445744 /* put zeros at the end */
57455745 if (!size_only && array_length < n) {
5746− init_putz(type, sec, c + array_length,
5746+ init_putz(type, sec, c + array_length,
57475747 n - array_length);
57485748 }
57495749 if (!no_oblock)
@@ -5795,7 +5795,7 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c, · 45 unmodified lines
57955795 zero, then a reference to the new object is put in the value stack.
57965796 If 'has_init' is 2, a special parsing is done to handle string
57975797 constants. */
5798−static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r,
5798+static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r,
57995799 int has_init, int v, char *asm_label,
58005800 int scope)
58015801 {
@@ -5826,7 +5826,7 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r, · 24 unmodified lines
58265826 initializers handling */
58275827 tok_str_new(&init_str);
58285828 if (size < 0 || (flexible_array && has_init)) {
5829− if (!has_init)
5829+ if (!has_init)
58305830 tcc_error("unknown type size");
58315831 /* get all init string */
58325832 if (has_init == 2) {
@@ -5855,7 +5855,7 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r, · 22 unmodified lines
58555855 }
58565856 tok_str_add(&init_str, -1);
58575857 tok_str_add(&init_str, 0);
5858−
5858+
58595859 /* compute size */
58605860 save_parse_state(&saved_parse_state);
58615861
@@ -5865,10 +5865,10 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r, · 3 unmodified lines
58655865 /* prepare second initializer parsing */
58665866 macro_ptr = init_str.str;
58675867 next();
5868−
5868+
58695869 /* if still unknown size, error */
58705870 size = type_size(type, &align);
5871− if (size < 0)
5871+ if (size < 0)
58725872 tcc_error("unknown type size");
58735873 }
58745874 if (flexible_array)
@@ -5919,14 +5919,14 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r, · 44 unmodified lines
59195919 sym = sym_find(v);
59205920 if (sym) {
59215921 if (!is_compatible_types(&sym->type, type))
5922− tcc_error("incompatible types for redefinition of '%s'",
5922+ tcc_error("incompatible types for redefinition of '%s'",
59235923 get_tok_str(v, NULL));
59245924 if (sym->type.t & VT_EXTERN) {
59255925 /* if the variable is extern, it was not allocated */
59265926 sym->type.t &= ~VT_EXTERN;
59275927 /* set array size if it was omitted in extern
59285928 declaration */
5929− if ((sym->type.t & VT_ARRAY) &&
5929+ if ((sym->type.t & VT_ARRAY) &&
59305930 sym->type.ref->c < 0 &&
59315931 type->ref->c >= 0)
59325932 sym->type.ref->c = type->ref->c;
@@ -5966,7 +5966,7 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r, · 33 unmodified lines
59665966 #endif
59675967 sec->data_offset = data_offset;
59685968 /* allocate section space to put the data */
5969− if (sec->sh_type != SHT_NOBITS &&
5969+ if (sec->sh_type != SHT_NOBITS &&
59705970 data_offset > sec->data_allocated)
59715971 section_realloc(sec, data_offset);
59725972 /* align section if needed */
@@ -6036,12 +6036,12 @@ static void put_func_debug(Sym *sym) · 63 unmodified lines
60366036
60376037 /* stabs info */
60386038 /* XXX: we put here a dummy type */
6039− snprintf(buf, sizeof(buf), "%s:%c1",
6039+ snprintf(buf, sizeof(buf), "%s:%c1",
60406040 funcname, sym->type.t & VT_STATIC ? 'f' : 'F');
60416041 put_stabs_r(buf, N_FUN, 0, file->line_num, 0,
60426042 cur_text_section, sym->c);
60436043 /* //gr gdb wants a line at the function */
6044− put_stabn(N_SLINE, 0, file->line_num, 0);
6044+ put_stabn(N_SLINE, 0, file->line_num, 0);
60456045 last_ind = 0;
60466046 last_line_num = 0;
60476047 }
@@ -6058,10 +6058,10 @@ static void func_decl_list(Sym *func_sym) · 10 unmodified lines
60586058 /* parse each declaration */
60596059 while (tok != '{' && tok != ';' && tok != ',' && tok != TOK_EOF &&
60606060 tok != TOK_ASM1 && tok != TOK_ASM2 && tok != TOK_ASM3) {
6061− if (!parse_btype(&btype, &ad))
6061+ if (!parse_btype(&btype, &ad))
60626062 expect("declaration list");
60636063 if (((btype.t & VT_BTYPE) == VT_ENUM ||
6064− (btype.t & VT_BTYPE) == VT_STRUCT) &&
6064+ (btype.t & VT_BTYPE) == VT_STRUCT) &&
60656065 tok == ';') {
60666066 /* we accept no variable after */
60676067 } else {
@@ -6080,7 +6080,7 @@ static void func_decl_list(Sym *func_sym) · 12 unmodified lines
60806080 found:
60816081 /* check that no storage specifier except 'register' was given */
60826082 if (type.t & VT_STORAGE)
6083− tcc_error("storage class specified for '%s'", get_tok_str(v, NULL));
6083+ tcc_error("storage class specified for '%s'", get_tok_str(v, NULL));
60846084 convert_parameter_type(&type);
60856085 /* we can add the type (NOTE: it could be local to the function) */
60866086 s->type = type;
@@ -6140,7 +6140,7 @@ static void gen_function(Sym *sym) · 53 unmodified lines
61406140 sym_pop(&local_stack, NULL);
61416141 /* end of function */
61426142 /* patch symbol size */
6143− ((ElfW(Sym) *)symtab_section->data)[sym->c].st_size =
6143+ ((ElfW(Sym) *)symtab_section->data)[sym->c].st_size =
61446144 ind - func_ind;
61456145 /* patch symbol weakness (this definition overrules any prototype) */
61466146 if (sym->type.t & VT_WEAK)
@@ -6234,7 +6234,7 @@ static int decl0(int l, int is_for_loop_init) · 87 unmodified lines
62346234 btype.t = VT_INT;
62356235 }
62366236 if (((btype.t & VT_BTYPE) == VT_ENUM ||
6237− (btype.t & VT_BTYPE) == VT_STRUCT) &&
6237+ (btype.t & VT_BTYPE) == VT_STRUCT) &&
62386238 tok == ';') {
62396239 if ((btype.t & VT_BTYPE) == VT_STRUCT) {
62406240 int v = btype.ref->v;
@@ -6273,7 +6273,7 @@ static int decl0(int l, int is_for_loop_init) · 32 unmodified lines
62736273 asm_label_instr(&astr);
62746274 asm_label = tcc_strdup(astr.data);
62756275 cstr_free(&astr);
6276−
6276+
62776277 /* parse one last attribute list, after asm label */
62786278 parse_attribute(&ad);
62796279 }
@@ -6299,11 +6299,11 @@ static int decl0(int l, int is_for_loop_init) · 19 unmodified lines
62996299 while ((sym = sym->next) != NULL)
63006300 if (!(sym->v & ~SYM_FIELD))
63016301 expect("identifier");
6302−
6302+
63036303 /* XXX: cannot do better now: convert extern line to static inline */
63046304 if ((type.t & (VT_EXTERN | VT_INLINE)) == (VT_EXTERN | VT_INLINE))
63056305 type.t = (type.t & ~VT_EXTERN) | VT_STATIC;
6306−
6306+
63076307 sym = sym_find(v);
63086308 if (sym) {
63096309 Sym *ref;
@@ -6334,7 +6334,7 @@ static int decl0(int l, int is_for_loop_init) · 24 unmodified lines
63346334
63356335 if (!is_compatible_types(&sym->type, &type)) {
63366336 func_error1:
6337− tcc_error("incompatible types for redefinition of '%s'",
6337+ tcc_error("incompatible types for redefinition of '%s'",
63386338 get_tok_str(v, NULL));
63396339 }
63406340 type.ref->a.func_proto = 0;
@@ -6349,18 +6349,18 @@ static int decl0(int l, int is_for_loop_init) · 8 unmodified lines
63496349 /* static inline functions are just recorded as a kind
63506350 of macro. Their code will be emitted at the end of
63516351 the compilation unit only if they are used */
6352− if ((type.t & (VT_INLINE | VT_STATIC)) ==
6352+ if ((type.t & (VT_INLINE | VT_STATIC)) ==
63536353 (VT_INLINE | VT_STATIC)) {
63546354 int block_level;
63556355 struct InlineFunc *fn;
63566356 const char *filename;
6357−
6357+
63586358 filename = file ? file->filename : "";
63596359 fn = tcc_malloc(sizeof *fn + strlen(filename));
63606360 strcpy(fn->filename, filename);
63616361 fn->sym = sym;
63626362 tok_str_new(&fn->func_str);
6363−
6363+
63646364 block_level = 0;
63656365 for(;;) {
63666366 int t;
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
tccpe.c+1−1
@@ -1266,7 +1266,7 @@ static int pe_check_symbols(struct pe_info *pe) · 1265 unmodified lines
12661266 put_elf_reloc(symtab_section, text_section,
12671267 offset + 8, R_XXX_THUNKFIX, is->iat_index); // offset to IAT position
12681268 #else
1269− put_elf_reloc(symtab_section, text_section,
1269+ put_elf_reloc(symtab_section, text_section,
12701270 offset + 2, R_XXX_THUNKFIX, is->iat_index);
12711271 #endif
12721272 is->thk_offset = offset;
tccpp.c+36−36
@@ -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
@@ -50,7 +50,7 @@ static unsigned char isidnum_table[256 - CH_EOF]; · 43 unmodified lines
5050
5151 static TokenString *macro_stack;
5252
53−static const char tcc_keywords[] =
53+static const char tcc_keywords[] =
5454 #define DEF(id, str) str "\0"
5555 #include "tcctok.h"
5656 #undef DEF
@@ -221,7 +221,7 @@ static TokenSym *tok_alloc_new(TokenSym **pts, const char *str, int len) · 164 unmodified lines
221221 TokenSym *ts, **ptable;
222222 int i;
223223
224− if (tok_ident >= SYM_FIRST_ANOM)
224+ if (tok_ident >= SYM_FIRST_ANOM)
225225 tcc_error("memory full (symbols)");
226226
227227 /* expand token table if needed */
@@ -255,7 +255,7 @@ ST_FUNC TokenSym *tok_alloc(const char *str, int len) · 27 unmodified lines
255255 TokenSym *ts, **pts;
256256 int i;
257257 unsigned int h;
258−
258+
259259 h = TOK_HASH_INIT;
260260 for(i=0;i<len;i++)
261261 h = TOK_HASH_FUNC(h, ((unsigned char *)str)[i]);
@@ -511,7 +511,7 @@ static int handle_stray1(uint8_t *p) · 249 unmodified lines
511511 ST_FUNC void minp(void)
512512 {
513513 inp();
514− if (ch == '\\')
514+ if (ch == '\\')
515515 handle_stray();
516516 }
517517
@@ -557,7 +557,7 @@ static uint8_t *parse_line_comment(uint8_t *p) · 39 unmodified lines
557557 ST_FUNC uint8_t *parse_comment(uint8_t *p)
558558 {
559559 int c;
560−
560+
561561 p++;
562562 for(;;) {
563563 /* fast skip loop */
@@ -635,13 +635,13 @@ static inline void skip_spaces(void) · 71 unmodified lines
635635 cinp();
636636 }
637637
638−static inline int check_space(int t, int *spc)
638+static inline int check_space(int t, int *spc)
639639 {
640640 if (t < 256 && (isidnum_table[t - CH_EOF] & IS_SPC)) {
641− if (*spc)
641+ if (*spc)
642642 return 1;
643643 *spc = 1;
644− } else
644+ } else
645645 *spc = 0;
646646 return 0;
647647 }
@@ -774,7 +774,7 @@ redo_start: · 126 unmodified lines
774774 file->buf_ptr = p;
775775 next_nomacro();
776776 p = file->buf_ptr;
777− if (a == 0 &&
777+ if (a == 0 &&
778778 (tok == TOK_ELSE || tok == TOK_ELIF || tok == TOK_ENDIF))
779779 goto the_end;
780780 if (tok == TOK_IF || tok == TOK_IFDEF || tok == TOK_IFNDEF)
@@ -930,7 +930,7 @@ static void tok_str_add2(TokenString *s, int t, CValue *cv) · 149 unmodified lines
930930 cstr->size = cv->cstr->size;
931931 cstr->data_allocated = NULL;
932932 cstr->size_allocated = cstr->size;
933− memcpy((char *)cstr + sizeof(CString),
933+ memcpy((char *)cstr + sizeof(CString),
934934 cv->cstr->data, cstr->size);
935935 len += nb_words;
936936 }
@@ -1253,14 +1253,14 @@ static int expr_preprocess(void) · 316 unmodified lines
12531253 {
12541254 int c, t;
12551255 TokenString str;
1256−
1256+
12571257 tok_str_new(&str);
12581258 while (tok != TOK_LINEFEED && tok != TOK_EOF) {
12591259 next(); /* do macro subst */
12601260 if (tok == TOK_DEFINED) {
12611261 next_nomacro();
12621262 t = tok;
1263− if (t == '(')
1263+ if (t == '(')
12641264 next_nomacro();
12651265 c = define_find(tok) != 0;
12661266 if (t == '(')
@@ -1914,7 +1914,7 @@ static void parse_escape_string(CString *outstr, const uint8_t *buf, int is_long · 647 unmodified lines
19141914 break;
19151915 case '\'':
19161916 case '\"':
1917− case '\\':
1917+ case '\\':
19181918 case '?':
19191919 break;
19201920 default:
@@ -2070,7 +2070,7 @@ static void parse_number(const char *p) · 149 unmodified lines
20702070 *q = '\0';
20712071 if (b == 16)
20722072 shift = 4;
2073− else
2073+ else
20742074 shift = 1;
20752075 bn_zero(bn);
20762076 q = token_buf;
@@ -2126,7 +2126,7 @@ static void parse_number(const char *p) · 49 unmodified lines
21262126 ch = *p++;
21272127 }
21282128 exp_val = exp_val * s;
2129−
2129+
21302130 /* now we can generate the number */
21312131 /* XXX: should patch directly float number */
21322132 d = (double)bn[1] * 4294967296.0 + (double)bn[0];
@@ -2363,7 +2363,7 @@ static inline void next_nomacro1(void) · 230 unmodified lines
23632363 } else {
23642364 tok_flags &= ~TOK_FLAG_EOF;
23652365 /* pop include file */
2366−
2366+
23672367 /* test if previous '#endif' was after a #ifdef at
23682368 start of file */
23692369 if (tok_flags & TOK_FLAG_ENDIF) {
@@ -2400,7 +2400,7 @@ maybe_newline: · 30 unmodified lines
24002400 case '#':
24012401 /* XXX: simplify */
24022402 PEEKC(c, p);
2403− if ((tok_flags & TOK_FLAG_BOL) &&
2403+ if ((tok_flags & TOK_FLAG_BOL) &&
24042404 (parse_flags & PARSE_FLAG_PREPROCESS)) {
24052405 file->buf_ptr = p;
24062406 preprocess(tok_flags & TOK_FLAG_BOF);
@@ -2420,7 +2420,7 @@ maybe_newline: · 13 unmodified lines
24202420 }
24212421 }
24222422 break;
2423−
2423+
24242424 /* dollar is allowed to start identifiers when not parsing asm */
24252425 case '$':
24262426 if (!(isidnum_table[c - CH_EOF] & IS_ID)
@@ -2433,14 +2433,14 @@ maybe_newline: · 6 unmodified lines
24332433 case 'm': case 'n': case 'o': case 'p':
24342434 case 'q': case 'r': case 's': case 't':
24352435 case 'u': case 'v': case 'w': case 'x':
2436− case 'y': case 'z':
2436+ case 'y': case 'z':
24372437 case 'A': case 'B': case 'C': case 'D':
24382438 case 'E': case 'F': case 'G': case 'H':
2439− case 'I': case 'J': case 'K':
2439+ case 'I': case 'J': case 'K':
24402440 case 'M': case 'N': case 'O': case 'P':
24412441 case 'Q': case 'R': case 'S': case 'T':
24422442 case 'U': case 'V': case 'W': case 'X':
2443− case 'Y': case 'Z':
2443+ case 'Y': case 'Z':
24442444 case '_':
24452445 parse_ident_fast:
24462446 p1 = p;
@@ -2594,7 +2594,7 @@ maybe_newline: · 147 unmodified lines
25942594 tok = TOK_GT;
25952595 }
25962596 break;
2597−
2597+
25982598 case '&':
25992599 PEEKC(c, p);
26002600 if (c == '&') {
@@ -2607,7 +2607,7 @@ maybe_newline: · 6 unmodified lines
26072607 tok = '&';
26082608 }
26092609 break;
2610−
2610+
26112611 case '|':
26122612 PEEKC(c, p);
26132613 if (c == '|') {
@@ -2633,7 +2633,7 @@ maybe_newline: · 19 unmodified lines
26332633 tok = '+';
26342634 }
26352635 break;
2636−
2636+
26372637 case '-':
26382638 PEEKC(c, p);
26392639 if (c == '-') {
@@ -2655,7 +2655,7 @@ maybe_newline: · 15 unmodified lines
26552655 PARSE2('*', '*', '=', TOK_A_MUL)
26562656 PARSE2('%', '%', '=', TOK_A_MOD)
26572657 PARSE2('^', '^', '=', TOK_A_XOR)
2658−
2658+
26592659 /* comments or operator */
26602660 case '/':
26612661 PEEKC(c, p);
@@ -2675,7 +2675,7 @@ maybe_newline: · 13 unmodified lines
26752675 tok = '/';
26762676 }
26772677 break;
2678−
2678+
26792679 /* simple tokens */
26802680 case '(':
26812681 case ')':
@@ -2730,7 +2730,7 @@ ST_FUNC void next_nomacro(void) · 48 unmodified lines
27302730 next_nomacro_spc();
27312731 } while (tok < 256 && (isidnum_table[tok - CH_EOF] & IS_SPC));
27322732 }
2733−
2733+
27342734
27352735 static void macro_subst(
27362736 TokenString *tok_str,
@@ -2924,7 +2924,7 @@ static int macro_subst_tok( · 187 unmodified lines
29242924 CValue cval;
29252925 CString cstr;
29262926 char buf[32];
2927−
2927+
29282928 /* if symbol is a macro, prepare substitution */
29292929 /* special macros */
29302930 if (tok == TOK___LINE__) {
@@ -2942,10 +2942,10 @@ static int macro_subst_tok( · 11 unmodified lines
29422942 time(&ti);
29432943 tm = localtime(&ti);
29442944 if (tok == TOK___DATE__) {
2945− snprintf(buf, sizeof(buf), "%s %2d %d",
2945+ snprintf(buf, sizeof(buf), "%s %2d %d",
29462946 ab_month_name[tm->tm_mon], tm->tm_mday, tm->tm_year + 1900);
29472947 } else {
2948− snprintf(buf, sizeof(buf), "%02d:%02d:%02d",
2948+ snprintf(buf, sizeof(buf), "%02d:%02d:%02d",
29492949 tm->tm_hour, tm->tm_min, tm->tm_sec);
29502950 }
29512951 cstrval = buf;
@@ -3010,8 +3010,8 @@ static int macro_subst_tok( · 58 unmodified lines
30103010 tok_str_new(&str);
30113011 parlevel = spc = 0;
30123012 /* NOTE: non zero sa->t indicates VA_ARGS */
3013− while ((parlevel > 0 ||
3014− (tok != ')' &&
3013+ while ((parlevel > 0 ||
3014+ (tok != ')' &&
30153015 (tok != ',' || sa->type.t)))) {
30163016 if (tok == TOK_EOF || tok == 0)
30173017 break;
@@ -3143,7 +3143,7 @@ static inline int *macro_twosharps(const int *ptr0) · 125 unmodified lines
31433143 /* given 'a##b', remove nosubsts preceding 'b' */
31443144 while ((t1 = *++ptr) == TOK_NOSUBST)
31453145 ;
3146− if (t1 && t1 != TOK_TWOSHARPS
3146+ if (t1 && t1 != TOK_TWOSHARPS
31473147 && t1 != ':') /* 'a##:' don't build a new token */
31483148 {
31493149 TOK_GET(&t1, &ptr, &cv1);
@@ -3181,7 +3181,7 @@ static void macro_subst( · 31 unmodified lines
31813181 int t, spc, nosubst;
31823182 CValue cval;
31833183 int *macro_str1 = NULL;
3184−
3184+
31853185 /* first scan for '##' operator handling */
31863186 ptr = macro_str;
31873187 spc = nosubst = 0;
@@ -3334,7 +3334,7 @@ ST_FUNC void preprocess_new(void) · 146 unmodified lines
33343334 : 0;
33353335
33363336 memset(hash_ident, 0, TOK_HASH_SIZE * sizeof(TokenSym *));
3337−
3337+
33383338 tok_ident = TOK_IDENT;
33393339 p = tcc_keywords;
33403340 while (*p) {
tcctok.h+1−1
@@ -36,7 +36,7 @@ · 35 unmodified lines
3636 DEF(TOK_RESTRICT2, "__restrict")
3737 DEF(TOK_RESTRICT3, "__restrict__")
3838 DEF(TOK_EXTENSION, "__extension__") /* gcc keyword */
39−
39+
4040 DEF(TOK_FLOAT, "float")
4141 DEF(TOK_DOUBLE, "double")
4242 DEF(TOK_BOOL, "_Bool")
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, TCC_RELOCATE_AUTO) == -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};
@@ -598,7 +598,7 @@ static int arg_align_test_callback(void *ptr) { · 134 unmodified lines
598598 }
599599
600600 static int arg_align_test(void) {
601− const char *src =
601+ const char *src =
602602 "long double f(long double a, int b, long double c, int d, long double e) {\n"
603603 " return a + c + e;\n"
604604 "}\n";
@@ -621,7 +621,7 @@ int main(int argc, char **argv) { · 16 unmodified lines
621621 int i;
622622 const char *testname = NULL;
623623 int retval = EXIT_SUCCESS;
624−
624+
625625 /* if tcclib.h and libtcc1.a are not installed, where can we find them */
626626 for (i = 1; i < argc; ++i) {
627627 if (!memcmp(argv[i], "run_test=", 9))
tests/tcctest.c+58−58
@@ -320,7 +320,7 @@ void macro_test(void) · 319 unmodified lines
320320 #line 200
321321 printf("__LINE__=%d __FILE__=%s\n",
322322 __LINE__, __FILE__);
323−#line 203 "test"
323+#line 203 "test"
324324 printf("__LINE__=%d __FILE__=%s\n",
325325 __LINE__, __FILE__);
326326 #line 227 "tcctest.c"
@@ -348,7 +348,7 @@ void macro_test(void) · 21 unmodified lines
348348 glue(a <, <= 2);
349349 printf("a=%d\n", a);
350350 }
351−
351+
352352 /* macro function with argument outside the macro string */
353353 #define MF_s MF_hello
354354 #define MF_hello(msg) printf("%s\n",msg)
@@ -357,7 +357,7 @@ void macro_test(void) · 2 unmodified lines
357357
358358 MF_s("hi");
359359 MF_t("hi");
360−
360+
361361 /* test macro substituion inside args (should not eat stream) */
362362 printf("qq=%d\n", qq(qq)(2));
363363
@@ -398,7 +398,7 @@ void recursive_macro_test(void) · 34 unmodified lines
398398 printf("%d\n", ELFW(ST_INFO)(STB_WEAK, ELFW(ST_TYPE)(123)));
399399
400400 #define WRAP(x) x
401−
401+
402402 #define print_num(x) print_num(__FILE__,__LINE__,x)
403403 print_num(123);
404404 WRAP(print_num(123));
@@ -537,7 +537,7 @@ void goto_test() · 132 unmodified lines
537537 /* This needs to parse as label, not as start of decl. */
538538 typedef_and_label:
539539 s_loop:
540− if (i >= 10)
540+ if (i >= 10)
541541 goto s_end;
542542 printf("%d", i);
543543 i++;
@@ -688,7 +688,7 @@ int main(int argc, char **argv) · 144 unmodified lines
688688 callsave_test();
689689 builtin_frame_address_test();
690690 intdiv_test();
691− return 0;
691+ return 0;
692692 }
693693
694694 int tab[3];
@@ -797,10 +797,10 @@ void expr_test() · 102 unmodified lines
797797 printf("%d\n", ~12);
798798 printf("%d\n", -12);
799799 printf("%d\n", +12);
800− printf("%d %d %d %d\n",
801− isid('a'),
802− isid('g'),
803− isid('T'),
800+ printf("%d %d %d %d\n",
801+ isid('a'),
802+ isid('g'),
803+ isid('T'),
804804 isid('('));
805805 }
806806
@@ -984,7 +984,7 @@ void struct_test() · 177 unmodified lines
984984 sizeof(struct aligntest3), __alignof__(struct aligntest3));
985985 printf("aligntest4 sizeof=%d alignof=%d\n",
986986 sizeof(struct aligntest4), __alignof__(struct aligntest4));
987−
987+
988988 /* empty structures (GCC extension) */
989989 printf("sizeof(struct empty) = %d\n", sizeof(struct empty));
990990 printf("alignof(struct empty) = %d\n", __alignof__(struct empty));
@@ -999,17 +999,17 @@ void char_short_test() · 8 unmodified lines
999999
10001000 var1 = 0x01020304;
10011001 var2 = 0xfffefdfc;
1002− printf("s8=%d %d\n",
1002+ printf("s8=%d %d\n",
10031003 *(char *)&var1, *(char *)&var2);
1004− printf("u8=%d %d\n",
1004+ printf("u8=%d %d\n",
10051005 *(unsigned char *)&var1, *(unsigned char *)&var2);
1006− printf("s16=%d %d\n",
1006+ printf("s16=%d %d\n",
10071007 *(short *)&var1, *(short *)&var2);
1008− printf("u16=%d %d\n",
1008+ printf("u16=%d %d\n",
10091009 *(unsigned short *)&var1, *(unsigned short *)&var2);
1010− printf("s32=%d %d\n",
1010+ printf("s32=%d %d\n",
10111011 *(int *)&var1, *(int *)&var2);
1012− printf("u32=%d %d\n",
1012+ printf("u32=%d %d\n",
10131013 *(unsigned int *)&var1, *(unsigned int *)&var2);
10141014 *(char *)&var1 = 0x08;
10151015 printf("var1=%x\n", var1);
@@ -1099,7 +1099,7 @@ void bool_test() · 83 unmodified lines
10991099 static int v1 = 34 ? : -1; /* constant case */
11001100 static int v2 = 0 ? : -1; /* constant case */
11011101 int a = 30;
1102−
1102+
11031103 printf("%d %d\n", v1, v2);
11041104 printf("%d %d\n", a - 30 ? : a * 2, a + 1 ? : a * 2);
11051105 }
@@ -1116,8 +1116,8 @@ static int tab_reinit[]; · 10 unmodified lines
11161116 static int tab_reinit[10];
11171117
11181118 //int cinit1; /* a global variable can be defined several times without error ! */
1119−int cinit1;
1120−int cinit1;
1119+int cinit1;
1120+int cinit1;
11211121 int cinit1 = 0;
11221122 int *cinit2 = (int []){3, 2, 1};
11231123
@@ -1157,7 +1157,7 @@ void compound_literal_test(void) · 33 unmodified lines
11571157
11581158 for(i=0;i<3;i++) {
11591159 p = (int []){1, 2, 4 + i};
1160− printf("%d %d %d\n",
1160+ printf("%d %d %d\n",
11611161 p[0],
11621162 p[1],
11631163 p[2]);
@@ -1188,7 +1188,7 @@ kr_test() · 24 unmodified lines
11881188 void num(int n)
11891189 {
11901190 char *tab, *p;
1191− tab = (char*)malloc(20);
1191+ tab = (char*)malloc(20);
11921192 p = tab;
11931193 while (1) {
11941194 *p = 48 + (n % 10);
@@ -1231,7 +1231,7 @@ void struct_assign_test(void) · 36 unmodified lines
12311231 struct structa1 lsta1, lsta2;
12321232 int i;
12331233 } s, *ps;
1234−
1234+
12351235 ps = &s;
12361236 ps->i = 4;
12371237 #if 0
@@ -1247,7 +1247,7 @@ void struct_assign_test(void) · 9 unmodified lines
12471247 s.lsta2.f2 = 2;
12481248 #endif
12491249 struct_assign_test1(ps->lsta2, 3, 4.5);
1250−
1250+
12511251 printf("before call: %d %d\n", s.lsta2.f1, s.lsta2.f2);
12521252 ps->lsta2 = struct_assign_test2(ps->lsta2, ps->i);
12531253 printf("after call: %d %d\n", ps->lsta2.f1, ps->lsta2.f2);
@@ -1300,9 +1300,9 @@ void cast_test() · 46 unmodified lines
13001300 printf("%d\n", a);
13011301 a = (scast = 65536) + 1;
13021302 printf("%d\n", a);
1303−
1303+
13041304 printf("sizeof(c) = %d, sizeof((int)c) = %d\n", sizeof(c), sizeof((int)c));
1305−
1305+
13061306 /* test cast from unsigned to signed short to int */
13071307 b = 0xf000;
13081308 d = (short)b;
@@ -1310,7 +1310,7 @@ void cast_test() · 1 unmodified line
13101310 b = 0xf0f0;
13111311 d = (char)b;
13121312 printf("((unsigned)(char)0x%08x) = 0x%08x\n", b, d);
1313−
1313+
13141314 /* test implicit int casting for array accesses */
13151315 c = 0;
13161316 tab[1] = 2;
@@ -1352,7 +1352,7 @@ char sinit8[] = "hello" "trala"; · 35 unmodified lines
13521352
13531353 struct structinit1 sinit9 = { 1, 2, 3 };
13541354 struct structinit1 sinit10 = { .f2 = 2, 3, .f1 = 1 };
1355−struct structinit1 sinit11 = { .f2 = 2, 3, .f1 = 1,
1355+struct structinit1 sinit11 = { .f2 = 2, 3, .f1 = 1,
13561356 #ifdef ALL_ISOC99
13571357 .farray[0] = 10,
13581358 .farray[1] = 11,
@@ -1437,36 +1437,36 @@ void init_test(void) · 78 unmodified lines
14371437 int linit15[10] = { linit1, linit1 + 1, [6] = linit1 + 2, };
14381438 struct linit16 { int a1, a2, a3, a4; } linit16 = { 1, .a3 = 2 };
14391439 int linit17 = sizeof(linit17);
1440−
1440+
14411441 printf("init_test:\n");
14421442
14431443 printf("sinit1=%d\n", sinit1);
14441444 printf("sinit2=%d\n", sinit2);
1445− printf("sinit3=%d %d %d %d\n",
1445+ printf("sinit3=%d %d %d %d\n",
14461446 sizeof(sinit3),
14471447 sinit3[0],
14481448 sinit3[1],
14491449 sinit3[2]
14501450 );
14511451 printf("sinit6=%d\n", sizeof(sinit6));
1452− printf("sinit7=%d %d %d %d\n",
1452+ printf("sinit7=%d %d %d %d\n",
14531453 sizeof(sinit7),
14541454 sinit7[0],
14551455 sinit7[1],
14561456 sinit7[2]
14571457 );
14581458 printf("sinit8=%s\n", sinit8);
1459− printf("sinit9=%d %d %d\n",
1459+ printf("sinit9=%d %d %d\n",
14601460 sinit9.f1,
14611461 sinit9.f2,
14621462 sinit9.f3
14631463 );
1464− printf("sinit10=%d %d %d\n",
1464+ printf("sinit10=%d %d %d\n",
14651465 sinit10.f1,
14661466 sinit10.f2,
14671467 sinit10.f3
14681468 );
1469− printf("sinit11=%d %d %d %d %d %d\n",
1469+ printf("sinit11=%d %d %d %d %d %d\n",
14701470 sinit11.f1,
14711471 sinit11.f2,
14721472 sinit11.f3,
@@ -1477,7 +1477,7 @@ void init_test(void) · 4 unmodified lines
14771477
14781478 for(i=0;i<3;i++)
14791479 for(j=0;j<2;j++)
1480− printf("[%d][%d] = %d %d %d\n",
1480+ printf("[%d][%d] = %d %d %d\n",
14811481 i, j, sinit4[i][j], sinit5[i][j], linit4[i][j]);
14821482 printf("linit1=%d\n", linit1);
14831483 printf("linit2=%d\n", linit2);
@@ -1486,7 +1486,7 @@ void init_test(void) · 2 unmodified lines
14861486
14871487 printf("sinit12=%s\n", sinit12);
14881488 printf("sinit13=%d %s %s %s\n",
1489− sizeof(sinit13),
1489+ sizeof(sinit13),
14901490 sinit13[0],
14911491 sinit13[1],
14921492 sinit13[2]);
@@ -1500,7 +1500,7 @@ void init_test(void) · 7 unmodified lines
15001500 printf("\n");
15011501 for(i=0;i<10;i++) printf(" %d", linit15[i]);
15021502 printf("\n");
1503− printf("%d %d %d %d\n",
1503+ printf("%d %d %d %d\n",
15041504 linit16.a1,
15051505 linit16.a2,
15061506 linit16.a3,
@@ -1599,13 +1599,13 @@ void bitfield_test(void) · 92 unmodified lines
15991599 printf("%d %d\n", sa, ca);
16001600
16011601 st1.f1 = 7;
1602− if (st1.f1 == -1)
1602+ if (st1.f1 == -1)
16031603 printf("st1.f1 == -1\n");
1604− else
1604+ else
16051605 printf("st1.f1 != -1\n");
1606− if (st1.f2 == -1)
1606+ if (st1.f2 == -1)
16071607 printf("st1.f2 == -1\n");
1608− else
1608+ else
16091609 printf("st1.f2 != -1\n");
16101610
16111611 /* bit sizes below must be bigger than 32 since GCC doesn't allow
@@ -1835,7 +1835,7 @@ void lloptest(long long a, long long b) · 223 unmodified lines
18351835 a + b,
18361836 a - b,
18371837 a * b);
1838−
1838+
18391839 if (b != 0) {
18401840 printf("arith1: " LONG_LONG_FORMAT " " LONG_LONG_FORMAT "\n",
18411841 a / b,
@@ -1856,7 +1856,7 @@ void lloptest(long long a, long long b) · 14 unmodified lines
18561856 a > b,
18571857 a >= b,
18581858 a <= b);
1859−
1859+
18601860 printf("utest: %d %d %d %d %d %d\n",
18611861 ua == ub,
18621862 ua != ub,
@@ -1932,7 +1932,7 @@ long long llfunc1(int a) · 69 unmodified lines
19321932 }
19331933
19341934 struct S {
1935− int id;
1935+ int id;
19361936 char item;
19371937 };
19381938
@@ -1953,8 +1953,8 @@ void longlong_test(void) · 14 unmodified lines
19531953 a = ia;
19541954 b = ua;
19551955 printf(LONG_LONG_FORMAT " " LONG_LONG_FORMAT "\n", a, b);
1956− printf(LONG_LONG_FORMAT " " LONG_LONG_FORMAT " " LONG_LONG_FORMAT " %Lx\n",
1957− (long long)1,
1956+ printf(LONG_LONG_FORMAT " " LONG_LONG_FORMAT " " LONG_LONG_FORMAT " %Lx\n",
1957+ (long long)1,
19581958 (long long)-2,
19591959 1LL,
19601960 0x1234567812345679);
@@ -2049,7 +2049,7 @@ void vprintf1(const char *fmt, ...) · 88 unmodified lines
20492049
20502050 va_start(aq, fmt);
20512051 va_copy(ap, aq);
2052−
2052+
20532053 p = fmt;
20542054 for(;;) {
20552055 c = *p;
@@ -2250,10 +2250,10 @@ void c99_vla_test(int size1, int size2) · 194 unmodified lines
22502250 int tab1[size][2], tab2[10][2];
22512251 void *tab1_ptr, *tab2_ptr, *bad_ptr;
22522252
2253− /* "size" should have been 'captured' at tab1 declaration,
2253+ /* "size" should have been 'captured' at tab1 declaration,
22542254 so modifying it should have no effect on VLA behaviour. */
22552255 size = size-1;
2256−
2256+
22572257 printf("Test C99 VLA 1 (sizeof): ");
22582258 printf("%s\n", (sizeof tab1 == size1 * size2 * 2 * sizeof(int)) ? "PASSED" : "FAILED");
22592259 tab1_ptr = tab1;
@@ -2325,7 +2325,7 @@ void sizeof_test(void) · 65 unmodified lines
23252325 t <<= 16;
23262326 t <<= 16;
23272327 t++;
2328− /* This checks that sizeof really can be used to manipulate
2328+ /* This checks that sizeof really can be used to manipulate
23292329 uintptr_t objects, without truncation. */
23302330 t2 = t & -sizeof(uintptr_t);
23312331 printf ("%lu %lu\n", t, t2);
@@ -2358,15 +2358,15 @@ void statement_expr_test(void) · 26 unmodified lines
23582358
23592359 a = 0;
23602360 for(i=0;i<10;i++) {
2361− a += 1 +
2362− ( { int b, j;
2363− b = 0;
2364− for(j=0;j<5;j++)
2365− b += j; b;
2361+ a += 1 +
2362+ ( { int b, j;
2363+ b = 0;
2364+ for(j=0;j<5;j++)
2365+ b += j; b;
23662366 } );
23672367 }
23682368 printf("a=%d\n", a);
2369−
2369+
23702370 }
23712371
23722372 void local_label_test(void)
@@ -2589,7 +2589,7 @@ void builtin_test(void) · 216 unmodified lines
25892589 COMPAT_TYPE(char *, signed char *);
25902590 COMPAT_TYPE(char *, char *);
25912591 /* space is needed because tcc preprocessor introduces a space between each token */
2592− COMPAT_TYPE(char * *, void *);
2592+ COMPAT_TYPE(char * *, void *);
25932593 #endif
25942594 printf("res = %d\n", __builtin_constant_p(1));
25952595 printf("res = %d\n", __builtin_constant_p(1 + 2));
@@ -2640,7 +2640,7 @@ void __attribute__((weak)) weak_test(void) · 44 unmodified lines
26402640 printf("weak_fpa=%d\n",&weak_fpa ? weak_fpa() : 123);
26412641 printf("weak_fpb=%d\n",&weak_fpb ? weak_fpb() : 123);
26422642 printf("weak_fpc=%d\n",&weak_fpc ? weak_fpc() : 123);
2643−
2643+
26442644 printf("weak_asm_f1=%d\n", weak_asm_f1 != NULL);
26452645 printf("weak_asm_f2=%d\n", weak_asm_f2 != NULL);
26462646 printf("weak_asm_f3=%d\n", weak_asm_f3 != NULL);
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;
x86_64-gen.c+30−30
@@ -681,7 +681,7 @@ ST_FUNC void gen_bounded_ptr_add(void) · 680 unmodified lines
681681
682682
683683 /* relocation offset of the bounding function call point */
684− vtop->c.ull = (cur_text_section->reloc->data_offset - sizeof(ElfW(Rela)));
684+ vtop->c.ull = (cur_text_section->reloc->data_offset - sizeof(ElfW(Rela)));
685685 }
686686
687687 /* patch pointer addition in vtop so that pointer dereferencing is
@@ -823,7 +823,7 @@ void gfunc_call(int nb_args) · 135 unmodified lines
823823 struct_size = args_size;
824824 for(i = 0; i < nb_args; i++) {
825825 SValue *sv;
826−
826+
827827 --arg;
828828 sv = &vtop[-i];
829829 bt = (sv->type.t & VT_BTYPE);
@@ -897,7 +897,7 @@ void gfunc_call(int nb_args) · 67 unmodified lines
897897 vtop->type.t = size > 4 ? VT_LLONG : size > 2 ? VT_INT
898898 : size > 1 ? VT_SHORT : VT_BYTE;
899899 }
900−
900+
901901 r = gv(RC_INT);
902902 if (arg >= REGN) {
903903 gen_offs_sp(0x89, r, arg*8);
@@ -911,7 +911,7 @@ void gfunc_call(int nb_args) · 7 unmodified lines
911911 vtop--;
912912 }
913913 save_regs(0);
914−
914+
915915 /* Copy R10 and R11 into RCX and RDX, respectively */
916916 if (nb_args > 0) {
917917 o(0xd1894c); /* mov %r10, %rcx */
@@ -919,7 +919,7 @@ void gfunc_call(int nb_args) · 1 unmodified line
919919 o(0xda894c); /* mov %r11, %rdx */
920920 }
921921 }
922−
922+
923923 gcall_or_jmp(0);
924924 vtop--;
925925 }
@@ -1072,10 +1072,10 @@ static X86_64_Mode classify_x86_64_inner(CType *ty, int offset, int start, int e · 146 unmodified lines
10721072 {
10731073 X86_64_Mode mode;
10741074 Sym *f;
1075−
1075+
10761076 switch (ty->t & VT_BTYPE) {
10771077 case VT_VOID: return x86_64_mode_none;
1078−
1078+
10791079 case VT_INT:
10801080 case VT_BYTE:
10811081 case VT_SHORT:
@@ -1084,12 +1084,12 @@ static X86_64_Mode classify_x86_64_inner(CType *ty, int offset, int start, int e · 2 unmodified lines
10841084 case VT_PTR:
10851085 case VT_FUNC:
10861086 case VT_ENUM: return x86_64_mode_integer;
1087−
1087+
10881088 case VT_FLOAT:
10891089 case VT_DOUBLE: return x86_64_mode_sse;
1090−
1090+
10911091 case VT_LDOUBLE: return x86_64_mode_x87;
1092−
1092+
10931093 case VT_STRUCT:
10941094 f = ty->ref;
10951095
@@ -1098,10 +1098,10 @@ static X86_64_Mode classify_x86_64_inner(CType *ty, int offset, int start, int e · 2 unmodified lines
10981098 if (f->c + offset >= start && f->c + offset < end)
10991099 mode = classify_x86_64_merge(mode, classify_x86_64_inner(&f->type, f->c + offset, start, end));
11001100 }
1101−
1101+
11021102 return mode;
11031103 }
1104−
1104+
11051105 assert(0);
11061106 }
11071107
@@ -1305,7 +1305,7 @@ void gfunc_call(int nb_args) · 197 unmodified lines
13051305 args_size = 0;
13061306 while (run_start != nb_args) {
13071307 int run_gen_reg = gen_reg, run_sse_reg = sse_reg;
1308−
1308+
13091309 run_end = nb_args;
13101310 stack_adjust = 0;
13111311 for(i = run_start; (i < nb_args) && (run_end == nb_args); i++) {
@@ -1319,10 +1319,10 @@ void gfunc_call(int nb_args) · 7 unmodified lines
13191319 stack_adjust += size;
13201320 }
13211321 }
1322−
1322+
13231323 gen_reg = run_gen_reg;
13241324 sse_reg = run_sse_reg;
1325−
1325+
13261326 /* adjust stack to align SSE boundary */
13271327 if (stack_adjust &= 15) {
13281328 /* fetch cpu flag before the following sub will change the value */
@@ -1334,7 +1334,7 @@ void gfunc_call(int nb_args) · 5 unmodified lines
13341334 oad(0xec81, stack_adjust); /* sub $xxx, %rsp */
13351335 args_size += stack_adjust;
13361336 }
1337−
1337+
13381338 for(i = run_start; i < run_end;) {
13391339 int arg_stored = regargs_nregs(&reg_args[i]) == 0;
13401340 SValue tmp;
@@ -1344,7 +1344,7 @@ void gfunc_call(int nb_args) · 3 unmodified lines
13441344 ++i;
13451345 continue;
13461346 }
1347−
1347+
13481348 /* Swap argument to top, it will possibly be changed here,
13491349 and might use more temps. At the end of the loop we keep
13501350 in on the stack and swap it back to its original position
@@ -1352,7 +1352,7 @@ void gfunc_call(int nb_args) · 1 unmodified line
13521352 tmp = vtop[0];
13531353 vtop[0] = vtop[-i];
13541354 vtop[-i] = tmp;
1355−
1355+
13561356 classify_x86_64_arg(&vtop->type, NULL, &size, &align, &args);
13571357
13581358 switch (vtop->type.t & VT_BTYPE) {
@@ -1369,11 +1369,11 @@ void gfunc_call(int nb_args) · 10 unmodified lines
13691369 vstore();
13701370 args_size += size;
13711371 break;
1372−
1372+
13731373 case VT_LDOUBLE:
13741374 assert(0);
13751375 break;
1376−
1376+
13771377 case VT_FLOAT:
13781378 case VT_DOUBLE:
13791379 r = gv(RC_FLOAT);
@@ -1384,7 +1384,7 @@ void gfunc_call(int nb_args) · 4 unmodified lines
13841384 o(0x24);
13851385 args_size += size;
13861386 break;
1387−
1387+
13881388 default:
13891389 /* simple type */
13901390 /* XXX: implicit cast ? */
@@ -1417,7 +1417,7 @@ void gfunc_call(int nb_args) · 26 unmodified lines
14171417 break;
14181418
14191419 vrotb(i+1);
1420−
1420+
14211421 if ((vtop->type.t & VT_BTYPE) == VT_LDOUBLE) {
14221422 gv(RC_ST0);
14231423 oad(0xec8148, size); /* sub $xxx, %rsp */
@@ -1440,7 +1440,7 @@ void gfunc_call(int nb_args) · 16 unmodified lines
14401440 vstore();
14411441 args_size += size;
14421442 }
1443−
1443+
14441444 vpop();
14451445 memmove(reg_args + i, reg_args + i + 1, (nb_args - i - 1) * sizeof *reg_args);
14461446 --nb_args;
@@ -1698,7 +1698,7 @@ void gfunc_prolog(CType *func_type) · 251 unmodified lines
16981698 addr += size;
16991699 }
17001700 break;
1701−
1701+
17021702 case x86_64_mode_memory:
17031703 case x86_64_mode_x87:
17041704 addr = (addr + align - 1) & -align;
@@ -2104,7 +2104,7 @@ void gen_opf(int op) · 399 unmodified lines
21042104 vswap();
21052105 }
21062106 assert(!(vtop[-1].r & VT_LVAL));
2107−
2107+
21082108 if ((vtop->type.t & VT_BTYPE) == VT_DOUBLE)
21092109 o(0x66);
21102110 if (op == TOK_EQ || op == TOK_NE)
@@ -2141,7 +2141,7 @@ void gen_opf(int op) · 30 unmodified lines
21412141 ft = vtop->type.t;
21422142 fc = vtop->c.ul;
21432143 assert((ft & VT_BTYPE) != VT_LDOUBLE);
2144−
2144+
21452145 r = vtop->r;
21462146 /* if saved lvalue, then we must reload it */
21472147 if ((vtop->r & VT_VALMASK) == VT_LLOCAL) {
@@ -2153,14 +2153,14 @@ void gen_opf(int op) · 5 unmodified lines
21532153 load(r, &v1);
21542154 fc = 0;
21552155 }
2156−
2156+
21572157 assert(!(vtop[-1].r & VT_LVAL));
21582158 if (swapped) {
21592159 assert(vtop->r & VT_LVAL);
21602160 gv(RC_FLOAT);
21612161 vswap();
21622162 }
2163−
2163+
21642164 if ((ft & VT_BTYPE) == VT_DOUBLE) {
21652165 o(0xf2);
21662166 } else {
@@ -2168,7 +2168,7 @@ void gen_opf(int op) · 1 unmodified line
21682168 }
21692169 o(0x0f);
21702170 o(0x58 + a);
2171−
2171+
21722172 if (vtop->r & VT_LVAL) {
21732173 gen_modrm(vtop[-1].r, r, vtop->sym, fc);
21742174 } else {
@@ -2231,7 +2231,7 @@ void gen_cvt_ftof(int t) · 56 unmodified lines
22312231 ft = vtop->type.t;
22322232 bt = ft & VT_BTYPE;
22332233 tbt = t & VT_BTYPE;
2234−
2234+
22352235 if (bt == VT_FLOAT) {
22362236 gv(RC_FLOAT);
22372237 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