Facebook
From Roel, 3 Years ago, written in Diff-output.
Embed
Download Paste or View Raw
Hits: 392
  1. commit e5eeb978ec6d432579b57f306c03d9954f8e790d
  2. Author: picobyte <[email protected]>
  3. Date:   Sun Sep 6 17:11:55 2020 +0200
  4.  
  5.     fix compilation
  6.    
  7.     Signed-off-by: picobyte <[email protected]>
  8.  
  9. diff --git a/compression/dict.c b/compression/dict.c
  10. index eccf8d2..34e0a84 100644
  11. --- a/compression/dict.c
  12. +++ b/compression/dict.c
  13. @@ -32,7 +32,7 @@ typedef struct
  14.      unsigned len;     // ¤«Ё­  б«®ў 
  15.      byte *ptr;        // ­ з «® б«®ў 
  16.  } dict_entry;
  17. -dict_entry dict[UCHAR_MAX+1];
  18. +static dict_entry dict[UCHAR_MAX+1];
  19.  
  20.  #define dict_get_byte()       (*ptr++)
  21.  #define dict_put_byte(c)      (*outptr++ = (c))
  22. diff --git a/compression/lzhuf.c b/compression/lzhuf.c
  23. index 37f9853..c59122f 100644
  24. --- a/compression/lzhuf.c
  25. +++ b/compression/lzhuf.c
  26. @@ -210,8 +210,8 @@ static int GetByte(void)   /* get one byte */
  27.      return (int)((i & 0xff00) >> 8);
  28.  }
  29.  
  30. -unsigned putbuf = 0;
  31. -uchar putlen = 0;
  32. +static unsigned putbuf = 0;
  33. +static uchar putlen = 0;
  34.  
  35.  /* initialization of tree */
  36.  
  37. @@ -312,7 +312,7 @@ static void update(int c)
  38.      } while ((c = prnt[c]) != 0); /* repeat up to root */
  39.  }
  40.  
  41. -unsigned code, len;
  42. +static unsigned code, len;
  43.  
  44.  static int DecodeChar(void)
  45.  {
  46. diff --git a/compression/rnc.c b/compression/rnc.c
  47. index a6f7c92..e182049 100644
  48. --- a/compression/rnc.c
  49. +++ b/compression/rnc.c
  50. @@ -161,7 +161,8 @@ typedef struct {
  51.  unsigned char blk[WINMAX];
  52.  int linkp[WINMAX];
  53.  int hashp[HASHMAX];
  54. -int blkstart, bpos;
  55. +int blkstart;
  56. +static int bpos;
  57.  int blklen;
  58.  
  59.  tuple tuples[MAXTUPLES];
  60. @@ -169,7 +170,8 @@ int ntuple;
  61.  
  62.  unsigned char *packed;
  63.  long packedlen;
  64. -long packedpos, bitpos, bitcount, bitbuf;
  65. +long packedpos, bitpos, bitcount;
  66. +static long bitbuf;
  67.  
  68.  static int hash (unsigned char *a) {
  69.      return ((a[0] * 7 + a[1]) * 7 + a[2]) % HASHMAX;
  70. diff --git a/compression/unjam.c b/compression/unjam.c
  71. index 4064ab6..9d873f4 100644
  72. --- a/compression/unjam.c
  73. +++ b/compression/unjam.c
  74. @@ -208,8 +208,10 @@ dic_item;
  75.  
  76.  dic_item *dic;
  77.  FILE *source, *target;
  78. -long bitbuf=0, bits=0;
  79. -int code_len=9, code, available=fst_code-1;
  80. +static long bitbuf=0;
  81. +static int code;
  82. +long bits=0;
  83. +int code_len=9, available=fst_code-1;
  84.  int mapped=0, tagged=0, pure_char=0;
  85.  
  86.  int read_code(void);
  87. diff --git a/compression/usq.c b/compression/usq.c
  88. index 2db61bd..c5672af 100644
  89. --- a/compression/usq.c
  90. +++ b/compression/usq.c
  91. @@ -89,7 +89,7 @@ EXTERN int curin;     /* last byte value read */
  92.  
  93.  /* Variables associated with repetition decoding */
  94.  EXTERN int repct;      /*Number of times to retirn value*/
  95. -EXTERN int value;      /*current byte value or EOF */
  96. +static int value;      /*current byte value or EOF */
  97.  
  98.  #define VERSION "3.3   10/29/86"
  99.  
  100. diff --git a/libs/glza/GLZAmodel.c b/libs/glza/GLZAmodel.c
  101. index 848cb5e..3ffe9a2 100644
  102. --- a/libs/glza/GLZAmodel.c
  103. +++ b/libs/glza/GLZAmodel.c
  104. @@ -20,20 +20,20 @@ limitations under the License.
  105.  #include "GLZAmodel.h"
  106.  #include <stdio.h>
  107.  
  108. -uint32_t InCharNum, OutCharNum;
  109. -uint32_t RangeLow, RangeHigh, count;
  110. -uint32_t low, code, range, extra_range;
  111. -uint8_t * InBuffer;
  112. -uint8_t FoundIndex;
  113. -uint8_t SymbolFirstChar[4][0x100][0x100];
  114. -uint8_t RangeScaleERG[3], RangeScaleWordTag;
  115. -uint8_t FreqERG[3], FreqWordTag, *OutBuffer;
  116. -uint16_t RangeScaleMtfQueueNum[2], RangeScaleMtfQueuePos[2][14], RangeScaleMtfgQueuePos[2];
  117. -uint16_t RangeScaleSID[2], RangeScaleINST[2][16];
  118. -uint16_t RangeScaleFirstChar[4][0x100];
  119. -uint16_t RangeScaleFirstCharSection[0x100][7];
  120. -uint16_t FreqSymType[4][4], FreqMtfQueueNum[2][14], FreqMtfQueuePos[2][14][64], FreqMtfgQueuePos[2][256];
  121. -uint16_t FreqSID[2][16], FreqINST[2][16][38], FreqFirstChar[4][0x100][0x100], FreqFirstCharBinary[0x100][0x100];
  122. +static uint32_t InCharNum, OutCharNum;
  123. +static uint32_t RangeLow, RangeHigh, count;
  124. +static uint32_t low, code, range, extra_range;
  125. +static uint8_t * InBuffer;
  126. +static uint8_t FoundIndex;
  127. +static uint8_t SymbolFirstChar[4][0x100][0x100];
  128. +static uint8_t RangeScaleERG[3], RangeScaleWordTag;
  129. +static uint8_t FreqERG[3], FreqWordTag, *OutBuffer;
  130. +static uint16_t RangeScaleMtfQueueNum[2], RangeScaleMtfQueuePos[2][14], RangeScaleMtfgQueuePos[2];
  131. +static uint16_t RangeScaleSID[2], RangeScaleINST[2][16];
  132. +static uint16_t RangeScaleFirstChar[4][0x100];
  133. +static uint16_t RangeScaleFirstCharSection[0x100][7];
  134. +static uint16_t FreqSymType[4][4], FreqMtfQueueNum[2][14], FreqMtfQueuePos[2][14][64], FreqMtfgQueuePos[2][256];
  135. +static uint16_t FreqSID[2][16], FreqINST[2][16][38], FreqFirstChar[4][0x100][0x100], FreqFirstCharBinary[0x100][0x100];
  136.  const uint32_t MTF_QUEUE_SIZE = 64;
  137.  
  138.  uint32_t ReadLow() {return(low);}
  139. @@ -1567,4 +1567,4 @@ void InitDecoder(uint8_t max_regular_code_length, uint8_t num_inst_codes, uint8_
  140.      StartModelFirstChar();
  141.    else
  142.      StartModelFirstCharBinary();
  143. -}
  144. \ No newline at end of file
  145. +}
  146. diff --git a/libs/nintendo_ds/lzss.c b/libs/nintendo_ds/lzss.c
  147. index 8c9de68..fa7de62 100644
  148. --- a/libs/nintendo_ds/lzss.c
  149. +++ b/libs/nintendo_ds/lzss.c
  150. @@ -58,7 +58,7 @@
  151.  
  152.  /*----------------------------------------------------------------------------*/
  153.  unsigned char ring[LZS_N + LZS_F - 1];
  154. -int           dad[LZS_N + 1], lson[LZS_N + 1], rson[LZS_N + 1 + 256];
  155. +static int           dad[LZS_N + 1], lson[LZS_N + 1], rson[LZS_N + 1 + 256];
  156.  int           pos_ring, len_ring, lzs_vram;
  157.  
  158.  /*----------------------------------------------------------------------------*/
  159. diff --git a/libs/tdcb/arith-n.c b/libs/tdcb/arith-n.c
  160. index 16377b1..2dc16be 100644
  161. --- a/libs/tdcb/arith-n.c
  162. +++ b/libs/tdcb/arith-n.c
  163. @@ -228,8 +228,8 @@ int current_order;
  164.   * can be excluded from lower order context total calculations.
  165.   */
  166.  
  167. -short int totals[ 258 ];
  168. -char scoreboard[ 256 ];
  169. +static short int totals[ 258 ];
  170. +static char scoreboard[ 256 ];
  171.  
  172.  /*
  173.   * Local procedure declarations for modeling routines.
  174. @@ -825,7 +825,7 @@ void arithn_flush_model()
  175.  static unsigned short int code;  /* The present input code value       */
  176.  static unsigned short int low;   /* Start of the current code range    */
  177.  static unsigned short int high;  /* End of the current code range      */
  178. -long underflow_bits;             /* Number of underflow bits pending   */
  179. +static long underflow_bits;             /* Number of underflow bits pending   */
  180.  
  181.  /*
  182.   * This routine must be called to initialize the encoding process.
  183. diff --git a/libs/tdcb/arith.c b/libs/tdcb/arith.c
  184. index 31b7487..6e74650 100644
  185. --- a/libs/tdcb/arith.c
  186. +++ b/libs/tdcb/arith.c
  187. @@ -392,7 +392,7 @@ memory_file *input;
  188.  static unsigned short int code;  /* The present input code value       */
  189.  static unsigned short int low;   /* Start of the current code range    */
  190.  static unsigned short int high;  /* End of the current code range      */
  191. -long underflow_bits;             /* Number of underflow bits pending   */
  192. +static long underflow_bits;             /* Number of underflow bits pending   */
  193.  
  194.  /*
  195.   * This routine must be called to initialize the encoding process.
  196. diff --git a/libs/tdcb/arith1.c b/libs/tdcb/arith1.c
  197. index ca8131c..059abfc 100644
  198. --- a/libs/tdcb/arith1.c
  199. +++ b/libs/tdcb/arith1.c
  200. @@ -28,7 +28,7 @@ typedef struct {
  201.  #define MAXIMUM_SCALE   16383  /* Maximum allowed frequency count        */
  202.  #define END_OF_STREAM   256    /* The EOF symbol                         */
  203.  
  204. -extern long underflow_bits;    /* The present underflow count in         */
  205. +static long underflow_bits;    /* The present underflow count in         */
  206.                                 /* the arithmetic coder.                  */
  207.  static int *totals[ 257 ] = {NULL};     /* Pointers to the 257 context tables     */
  208.  
  209. @@ -251,7 +251,7 @@ SYMBOL *s;
  210.  static unsigned short int code;  /* The present input code value       */
  211.  static unsigned short int low;   /* Start of the current code range    */
  212.  static unsigned short int high;  /* End of the current code range      */
  213. -long underflow_bits;             /* Number of underflow bits pending   */
  214. +static long underflow_bits;             /* Number of underflow bits pending   */
  215.  
  216.  /*
  217.   * This routine must be called to initialize the encoding process.
  218. diff --git a/libs/tdcb/arith1e.c b/libs/tdcb/arith1e.c
  219. index 4ecff91..ddd1acb 100644
  220. --- a/libs/tdcb/arith1e.c
  221. +++ b/libs/tdcb/arith1e.c
  222. @@ -283,7 +283,7 @@ SYMBOL *s;
  223.  static unsigned short int code;  /* The present input code value       */
  224.  static unsigned short int low;   /* Start of the current code range    */
  225.  static unsigned short int high;  /* End of the current code range      */
  226. -long underflow_bits;             /* Number of underflow bits pending   */
  227. +static long underflow_bits;             /* Number of underflow bits pending   */
  228.  
  229.  /*
  230.   * This routine must be called to initialize the encoding process.
  231. diff --git a/libs/tdcb/lzw12.c b/libs/tdcb/lzw12.c
  232. index 6b8f9f5..9fcfc2e 100644
  233. --- a/libs/tdcb/lzw12.c
  234. +++ b/libs/tdcb/lzw12.c
  235. @@ -50,7 +50,7 @@ struct dictionary {
  236.      char character;
  237.  } dict[ TABLE_SIZE ];
  238.  
  239. -char decode_stack[ TABLE_SIZE ];
  240. +static char decode_stack[ TABLE_SIZE ];
  241.  
  242.  /*
  243.   * The compressor is short and simple.  It reads in new symbols one
  244. diff --git a/libs/tdcb/lzw15v.c b/libs/tdcb/lzw15v.c
  245. index 1c3654d..88619b8 100644
  246. --- a/libs/tdcb/lzw15v.c
  247. +++ b/libs/tdcb/lzw15v.c
  248. @@ -82,7 +82,7 @@ static struct dictionary {
  249.   * trigger the next jump in word size.
  250.   */
  251.  
  252. -char decode_stack[ TABLE_SIZE ];
  253. +static char decode_stack[ TABLE_SIZE ];
  254.  unsigned int next_code;
  255.  int current_code_bits;
  256.  unsigned int next_bump_code;
  257.  
  258. commit 7b726c664f1ee3e72590c20a21f5ae28dbb78494
  259. Author: picobyte <[email protected]>
  260. Date:   Sun Sep 6 14:05:27 2020 +0200
  261.  
  262.     try to circumvent pie
  263.  
  264. diff --git a/Makefile b/Makefile
  265. index 93605a8..119d724 100644
  266. --- a/Makefile
  267. +++ b/Makefile
  268. @@ -1,6 +1,6 @@
  269.  EXE            = quickbms
  270.  # -m32 because QuickBMS has been tested only on 32bit systems and gives problems using 64bit native code
  271. -CFLAGS += -m32 -s -O2 -fstack-protector-all -fno-unit-at-a-time -fno-omit-frame-pointer -w
  272. +CFLAGS += -m32 -s -O2 -fstack-protector-all -fno-unit-at-a-time -fno-omit-frame-pointer -no-pie -fno-pie -w
  273.  # Add -DQUICKBMS64 to CDEFS for compiling quickbms_4gb_files
  274.  # For static builds on Linux (no MacOSX due to -lcrt0 error) add: -static
  275.  # -ldl is in CDEFS to avoid undefined references
  276.  

Replies to quickbms compilation fix rss

Title Name Language When
EXE = quickbms # -m32 because QuickBMS has been t chris c 1 Year ago.