diff options
Diffstat (limited to 'archivers/ruby-lha/files/patch-warnings')
-rw-r--r-- | archivers/ruby-lha/files/patch-warnings | 377 |
1 files changed, 0 insertions, 377 deletions
diff --git a/archivers/ruby-lha/files/patch-warnings b/archivers/ruby-lha/files/patch-warnings deleted file mode 100644 index 75da76ac771a..000000000000 --- a/archivers/ruby-lha/files/patch-warnings +++ /dev/null @@ -1,377 +0,0 @@ ---- ext/crcio.c.orig 2006-09-17 16:38:22 UTC -+++ ext/crcio.c -@@ -33,11 +33,13 @@ make_crctable( /* void */ ) - - /* ------------------------------------------------------------------------ */ - unsigned int --calccrc(crc, p, n) -+calccrc(crc, _p, n) - unsigned int crc; -- unsigned char *p; -+ const void *_p; - unsigned int n; - { -+ const unsigned char *p = _p; -+ - while (n-- > 0) - crc = UPDATE_CRC(crc, *p++); - return crc; -@@ -67,7 +69,7 @@ fread_crc(crcp, p, n, fp) - void - fwrite_crc(crcp, p, n, fp) - unsigned int *crcp; -- unsigned char *p; -+ const unsigned char *p; - int n; - FILE *fp; - { -@@ -138,11 +140,13 @@ putc_euc(c, fd) - - /* ------------------------------------------------------------------------ */ - int --fwrite_txt(p, n, fp) -- unsigned char *p; -+fwrite_txt(_p, n, fp) -+ const void *_p; - int n; - FILE *fp; - { -+ const unsigned char *p = _p; -+ - while (--n >= 0) { - if (*p != '\015' && *p != '\032') { - #ifdef EUC -@@ -160,13 +164,14 @@ fwrite_txt(p, n, fp) - - /* ------------------------------------------------------------------------ */ - int --fread_txt(p, n, fp) -- unsigned char *p; -+fread_txt(_p, n, fp) -+ void *_p; - int n; - FILE *fp; - { - int c; - int cnt = 0; -+ unsigned char *p = _p; - - while (cnt < n) { - if (getc_euc_cache != EOF) { ---- ext/extract.c.orig 2006-09-17 17:45:51 UTC -+++ ext/extract.c -@@ -14,7 +14,7 @@ decode_lzhuf(infp, outfp, original_size, - FILE *outfp; - size_t original_size; - size_t packed_size; -- char *name; -+ const char *name; - int method; - size_t *read_sizep; - { ---- ext/header.c.orig 2006-09-17 16:38:22 UTC -+++ ext/header.c -@@ -48,12 +48,13 @@ int default_system_kanji_code = MULTIBYT - int default_system_kanji_code = NONE; - #endif - --int --calc_sum(p, len) -- char *p; -+static int -+calc_sum(_p, len) -+ const void *_p; - int len; - { - int sum = 0; -+ const char *p = _p; - - while (len--) sum += *p++; - -@@ -67,7 +68,7 @@ dump_get_byte() - int c; - - if (verbose_listing && verbose > 1) -- printf("%02d %2d: ", get_ptr - start_ptr, 1); -+ printf("%02td %2d: ", get_ptr - start_ptr, 1); - c = GET_BYTE(); - if (verbose_listing && verbose > 1) { - if (isprint(c)) -@@ -84,7 +85,7 @@ dump_skip_bytes(len) - { - if (len == 0) return; - if (verbose_listing && verbose > 1) { -- printf("%02d %2d: ", get_ptr - start_ptr, len); -+ printf("%02td %2d: ", get_ptr - start_ptr, len); - while (len--) - printf("0x%02x ", GET_BYTE()); - printf("... ignored\n"); -@@ -102,7 +103,7 @@ get_word() - - #if DUMP_HEADER - if (verbose_listing && verbose > 1) -- printf("%02d %2d: ", get_ptr - start_ptr, 2); -+ printf("%02td %2d: ", get_ptr - start_ptr, 2); - #endif - b0 = GET_BYTE(); - b1 = GET_BYTE(); -@@ -130,7 +131,7 @@ get_longword() - - #if DUMP_HEADER - if (verbose_listing && verbose > 1) -- printf("%02d %2d: ", get_ptr - start_ptr, 4); -+ printf("%02td %2d: ", get_ptr - start_ptr, 4); - #endif - b0 = GET_BYTE(); - b1 = GET_BYTE(); -@@ -163,7 +164,7 @@ get_bytes(buf, len, size) - - #if DUMP_HEADER - if (verbose_listing && verbose > 1) -- printf("%02d %2d: \"", get_ptr - start_ptr, len); -+ printf("%02td %2d: \"", get_ptr - start_ptr, len); - - for (i = 0; i < len; i++) { - if (i < size) buf[i] = get_ptr[i]; -@@ -1171,11 +1172,11 @@ seek_lha_header(fp) - - - /* remove leading `xxxx/..' */ --static char * --remove_leading_dots(char *path) -+static const char * -+remove_leading_dots(const char *path) - { -- char *first = path; -- char *ptr = 0; -+ const char *first = path; -+ const char *ptr = NULL; - - if (strcmp(first, "..") == 0) { - warning("Removing leading `..' from member name."); -@@ -1200,7 +1201,7 @@ remove_leading_dots(char *path) - } - - if (ptr) { -- warning("Removing leading `%.*s' from member name.", ptr-first, first); -+ warning("Removing leading `%.*s' from member name.", (int)(ptr - first), first); - return ptr; - } - ---- ext/huf.c.orig 2006-09-17 16:38:22 UTC -+++ ext/huf.c -@@ -234,9 +234,7 @@ send_block( /* void */ ) - /* ------------------------------------------------------------------------ */ - /* lh4, 5, 6, 7 */ - void --output_st1(c, p) -- unsigned short c; -- unsigned short p; -+output_st1(unsigned short c, unsigned short p) - { - static unsigned short cpos; - ---- ext/lha.h.orig 2006-09-18 08:53:29 UTC -+++ ext/lha.h -@@ -211,6 +211,8 @@ int fnmatch(const char *pattern, const c - - #include "lha_macro.h" - -+unsigned char *alloc_buf(void); -+ - #define exit(n) lha_exit(n) - - struct encode_option { -@@ -300,41 +302,56 @@ LHALIB_EXTERN void cmd_extract(const cha - LHALIB_EXTERN FILE * open_old_archive(const char* archive); - LHALIB_EXTERN boolean need_file(const char*); - LHALIB_EXTERN boolean archive_is_msdos_sfx1(const char*); --LHALIB_EXTERN void output_dyn(); --LHALIB_EXTERN void encode_start_fix(); --LHALIB_EXTERN void encode_end_dyn(); --LHALIB_EXTERN void output_st1(); --LHALIB_EXTERN void encode_start_st0(); --LHALIB_EXTERN void encode_end_st0(); --LHALIB_EXTERN void encode_start_st1(); --LHALIB_EXTERN void encode_end_st1(); --LHALIB_EXTERN unsigned short decode_c_dyn(); --LHALIB_EXTERN unsigned short decode_p_dyn(); --LHALIB_EXTERN void decode_start_fix(); --LHALIB_EXTERN void decode_start_dyn(); --LHALIB_EXTERN void decode_start_st0(); --LHALIB_EXTERN void decode_start_st1(); --LHALIB_EXTERN unsigned short decode_c_st0(); --LHALIB_EXTERN unsigned short decode_c_st1(); --LHALIB_EXTERN unsigned short decode_p_st0(); --LHALIB_EXTERN unsigned short decode_p_st1(); --LHALIB_EXTERN unsigned short decode_c_lzs(); --LHALIB_EXTERN unsigned short decode_p_lzs(); --LHALIB_EXTERN void decode_start_lzs(); --LHALIB_EXTERN unsigned short decode_c_lz5(); --LHALIB_EXTERN unsigned short decode_p_lz5(); --LHALIB_EXTERN void decode_start_lz5(); --LHALIB_EXTERN void make_crctable(); -+LHALIB_EXTERN void output_dyn(unsigned int code, unsigned int pos); -+LHALIB_EXTERN void encode_start_fix(void); -+LHALIB_EXTERN void encode_end_dyn(void); -+LHALIB_EXTERN void output_st1(unsigned short c, unsigned short p); -+LHALIB_EXTERN void encode_start_st0(void); -+LHALIB_EXTERN void encode_end_st0(void); -+LHALIB_EXTERN void encode_start_st1(void); -+LHALIB_EXTERN void encode_end_st1(void); -+LHALIB_EXTERN void start_c_dyn(void); -+LHALIB_EXTERN unsigned short decode_c_dyn(void); -+LHALIB_EXTERN unsigned short decode_p_dyn(void); -+LHALIB_EXTERN void decode_start_fix(void); -+LHALIB_EXTERN void decode_start_dyn(void); -+LHALIB_EXTERN void decode_start_st0(void); -+LHALIB_EXTERN void decode_start_st1(void); -+LHALIB_EXTERN unsigned short decode_c_st0(void); -+LHALIB_EXTERN unsigned short decode_c_st1(void); -+LHALIB_EXTERN unsigned short decode_p_st0(void); -+LHALIB_EXTERN unsigned short decode_p_st1(void); -+LHALIB_EXTERN unsigned short decode_c_lzs(void); -+LHALIB_EXTERN unsigned short decode_p_lzs(void); -+LHALIB_EXTERN void decode_start_lzs(void); -+LHALIB_EXTERN unsigned short decode_c_lz5(void); -+LHALIB_EXTERN unsigned short decode_p_lz5(void); -+LHALIB_EXTERN void decode_start_lz5(void); -+LHALIB_EXTERN void make_crctable(void); - LHALIB_EXTERN size_t copyfile(FILE* f1, FILE* f2, size_t size, int text_flg, unsigned int* crcp); --LHALIB_EXTERN void init_getbits(); --LHALIB_EXTERN void init_code_cache(); -+LHALIB_EXTERN void init_getbits(void); -+LHALIB_EXTERN void init_putbits(void); -+LHALIB_EXTERN void init_code_cache(void); - LHALIB_EXTERN void putcode(unsigned char n, unsigned short x); - LHALIB_EXTERN void putbits(unsigned char n, unsigned short x); - LHALIB_EXTERN unsigned short getbits(unsigned char n); - LHALIB_EXTERN void fillbuf(unsigned char n); - LHALIB_EXTERN void encode_p_st0(unsigned short j); - -- -+NORETURN(void lha_exit(int n)); -+unsigned int calccrc(unsigned int crc, const void *p, unsigned int length); -+int fread_txt(void *p, int n, FILE *fp); -+int fwrite_txt(const void *p, int n, FILE *fp); -+int fread_crc(unsigned int *crcp, unsigned char *p, int n, FILE *fp); -+void fwrite_crc(unsigned int *crcp, const unsigned char *p, int n, FILE *fp); -+void make_table(short nchar, const unsigned char bitlenp[], short tablebits, unsigned short table[]); -+unsigned int decode(struct interfacing *intf); -+short make_tree(int nchar, unsigned short *freqp, unsigned char *bitlenp, unsigned short *codep); -+int str_safe_copy(char *dst, const char *src, int dstsz); -+int decode_lzhuf(FILE *in, FILE *out, size_t original, size_t packed, const char *name, int method, size_t *readp); -+int seek_lha_header(FILE *fp); -+boolean get_header(FILE *fp, LzHeader *hdr); -+PRINTF_ARGS(int xsnprintf(char *dst, size_t size, const char *fmt, ...), 3, 4); - - #define start_indicator(name, size, ing, len) 0 - #define finish_indicator(name, ed) 0 ---- ext/lhalib.c.orig 2006-09-18 09:11:35 UTC -+++ ext/lhalib.c -@@ -18,7 +18,7 @@ - #define LHALIB_VERSION "0.8.1" - - #include "lha.h" --#include "st.h" -+#include <ruby/st.h> - - static VALUE lhalib; - -@@ -75,7 +75,7 @@ static VALUE s_ex(int argc, VALUE* argv, - VALUE file; - proc = Qnil; - rb_scan_args(argc, argv, "1&", &file, &proc); -- rb_check_safe_str(file); -+ SafeStringValue(file); - rb_secure(4); - - file_count = 0; ---- ext/lharc.c.orig 2006-09-17 16:38:22 UTC -+++ ext/lharc.c -@@ -52,7 +52,7 @@ static int error_occurred; - /* ------------------------------------------------------------------------ */ - static boolean - open_old_archive_1(name, v_fp) -- char *name; -+ const char *name; - FILE **v_fp; - { - FILE *fp; ---- ext/lhext.c.orig 2006-09-17 16:38:22 UTC -+++ ext/lhext.c -@@ -26,8 +26,9 @@ static char *methods[] = - NULL - }; - --static void add_dirinfo(char* name, LzHeader* hdr); --static void adjust_dirinfo(); -+static void add_dirinfo(const char* name, LzHeader* hdr); -+static void adjust_dirinfo(void); -+static int is_directory_traversal(const char *path); - - /* ------------------------------------------------------------------------ */ - static boolean -@@ -395,8 +396,8 @@ cmd_extract(const char* archive_name, ad - return; - } - --int --is_directory_traversal(char *path) -+static int -+is_directory_traversal(const char *path) - { - int state = 0; - -@@ -436,7 +437,7 @@ typedef struct lhdDirectoryInfo_t { - - static LzHeaderList *dirinfo; - --static void add_dirinfo(char *name, LzHeader *hdr) -+static void add_dirinfo(const char *name, LzHeader *hdr) - { - LzHeaderList *p; - ---- ext/maketbl.c.orig 2006-09-17 16:38:22 UTC -+++ ext/maketbl.c -@@ -9,11 +9,8 @@ - #include "lha.h" - - void --make_table(nchar, bitlen, tablebits, table) -- short nchar; -- unsigned char bitlen[]; -- short tablebits; -- unsigned short table[]; -+make_table(short nchar, const unsigned char bitlen[], short tablebits, -+ unsigned short table[]) - { - unsigned short count[17]; /* count of bitlen */ - unsigned short weight[17]; /* 0x10000ul >> bitlen */ ---- ext/maketree.c.orig 2006-09-17 17:36:33 UTC -+++ ext/maketree.c -@@ -95,7 +95,7 @@ downheap(i, heap, heapsize, freq) - int i; - short *heap; - size_t heapsize; -- unsigned short *freq; -+ const unsigned short *freq; - { - short j, k; - ---- ext/util.c.orig 2006-09-18 08:53:29 UTC -+++ ext/util.c -@@ -114,10 +114,11 @@ archive_is_msdos_sfx1(const char* name) - - int - #if STDC_HEADERS --xsnprintf(char *dest, size_t size, char *fmt, ...) -+xsnprintf(char *dest, size_t size, const char *fmt, ...) - #else - xsnprintf(dest, size, fmt, va_alist) -- char *dest, *fmt; -+ char *dest; -+ const char *fmt; - size_t size; - va_dcl - #endif |