History

use uchar instead of int to save memory

Sergey Sushilin committed 6 years ago

Commit 4873f6f1 parent 14fc6b61 file · +31 −31Browse files

Unified · Split

tcc.h+31−31
@@ -493,19 +493,19 @@ typedef struct Sym { · 492 unmodified lines
493493 int c; /* associated number or Elf symbol index */
494494 union {
495495 int sym_scope; /* scope level for locals */
496− int jnext; /* next jump label */
496+ int jnext; /* next jump label */
497497 struct FuncAttr f; /* function attributes */
498498 int auxtype; /* bitfield access type */
499499 };
500500 };
501501 long long enum_val; /* enum constant if IS_ENUM_VAL */
502502 int *d; /* define token stream */
503− struct Sym *ncl; /* next cleanup */
503+ struct Sym *ncl; /* next cleanup */
504504 };
505505 CType type; /* associated type */
506506 union {
507507 struct Sym *next; /* next related symbol (for fields and anoms) */
508− struct Sym *cleanupstate; /* in defined labels */
508+ struct Sym *cleanupstate; /* in defined labels */
509509 int asm_label; /* associated asm label */
510510 };
511511 struct Sym *prev; /* prev symbol in stack */
@@ -673,20 +673,20 @@ struct sym_attr { · 161 unmodified lines
673673 };
674674
675675 struct TCCState {
676− int verbose; /* if true, display some information during compilation */
677− int nostdinc; /* if true, no standard headers are added */
678− int nostdlib; /* if true, no standard libraries are added */
679− int nocommon; /* if true, do not use common symbols for .bss data */
680− int static_link; /* if true, static linking is performed */
681− int rdynamic; /* if true, all symbols are exported */
682− int symbolic; /* if true, resolve symbols in the current module first */
683− int filetype; /* file type for compilation (NONE,C,ASM) */
684− int cversion; /* supported C ISO version, 199901 (the default), 201112, ... */
676+ unsigned char verbose; /* if true, display some information during compilation */
677+ unsigned char nostdinc; /* if true, no standard headers are added */
678+ unsigned char nostdlib; /* if true, no standard libraries are added */
679+ unsigned char nocommon; /* if true, do not use common symbols for .bss data */
680+ unsigned char static_link; /* if true, static linking is performed */
681+ unsigned char rdynamic; /* if true, all symbols are exported */
682+ unsigned char symbolic; /* if true, resolve symbols in the current module first */
683+ unsigned char filetype; /* file type for compilation (NONE,C,ASM) */
684+ unsigned int cversion; /* supported C ISO version, 199901 (the default), 201112, ... */
685685
686686 char *tcc_lib_path; /* CONFIG_TCCDIR or -B option */
687687 char *soname; /* as specified on the command line (-soname) */
688688 char *rpath; /* as specified on the command line (-Wl,-rpath=) */
689− int enable_new_dtags; /* ditto, (-Wl,--enable-new-dtags) */
689+ unsigned char enable_new_dtags; /* ditto, (-Wl,--enable-new-dtags) */
690690
691691 /* output type, see TCC_OUTPUT_XXX */
692692 int output_type;
@@ -694,33 +694,33 @@ struct TCCState { · 1 unmodified line
694694 int output_format;
695695
696696 /* C language options */
697− int char_is_unsigned;
698− int leading_underscore;
699− int ms_extensions; /* allow nested named struct w/o identifier behave like unnamed */
700− int dollars_in_identifiers; /* allows '$' char in identifiers */
701− int ms_bitfields; /* if true, emulate MS algorithm for aligning bitfields */
697+ unsigned char char_is_unsigned;
698+ unsigned char leading_underscore;
699+ unsigned char ms_extensions; /* allow nested named struct w/o identifier behave like unnamed */
700+ unsigned char dollars_in_identifiers; /* allows '$' char in identifiers */
701+ unsigned char ms_bitfields; /* if true, emulate MS algorithm for aligning bitfields */
702702
703703 /* warning switches */
704− int warn_write_strings;
705− int warn_unsupported;
706− int warn_error;
707− int warn_none;
708− int warn_implicit_function_declaration;
709− int warn_gcc_compat;
704+ unsigned char warn_write_strings;
705+ unsigned char warn_unsupported;
706+ unsigned char warn_error;
707+ unsigned char warn_none;
708+ unsigned char warn_implicit_function_declaration;
709+ unsigned char warn_gcc_compat;
710710
711711 /* compile with debug symbol (and use them if error during execution) */
712− int do_debug;
712+ unsigned char do_debug;
713713 #ifdef CONFIG_TCC_BCHECK
714714 /* compile with built-in memory and bounds checker */
715− int do_bounds_check;
715+ unsigned char do_bounds_check;
716716 #endif
717717 #ifdef TCC_TARGET_ARM
718718 enum float_abi float_abi; /* float ABI of the generated code*/
719719 #endif
720− int run_test; /* nth test to run with -dt -run */
720+ unsigned char run_test; /* nth test to run with -dt -run */
721721
722722 addr_t text_addr; /* address of text section */
723− int has_text_addr;
723+ unsigned char has_text_addr;
724724
725725 unsigned section_align; /* section alignment */
726726
@@ -847,11 +847,11 @@ struct TCCState { · 120 unmodified lines
847847 int nb_files; /* number thereof */
848848 int nb_libraries; /* number of libs thereof */
849849 char *outfile; /* output filename */
850− int option_r; /* option -r */
851− int do_bench; /* option -bench */
850+ unsigned char option_r; /* option -r */
851+ unsigned char do_bench; /* option -bench */
852852 int gen_deps; /* option -MD */
853853 char *deps_outfile; /* option -MF */
854− int option_pthread; /* -pthread option */
854+ unsigned char option_pthread; /* -pthread option */
855855 int argc;
856856 char **argv;
857857 };

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