From bbf5e26a71d1557f5b4c88163024032ee4a63d8d Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Wed, 30 Jun 2010 22:06:49 +0300 Subject: [PATCH] misc --- archivers/lha/huf.cpp | 14 +++++++------- archivers/lha/lha.h | 2 +- archivers/lha/lhamaketbl.cpp | 6 +++--- archivers/lha/shuf.cpp | 12 ++++++------ cfgfile.cpp | 4 ++-- include/sysdeps.h | 4 ++++ readcpu.cpp | 12 ++++++------ 7 files changed, 29 insertions(+), 25 deletions(-) diff --git a/archivers/lha/huf.cpp b/archivers/lha/huf.cpp index e6ddd3f7..dec8868c 100644 --- a/archivers/lha/huf.cpp +++ b/archivers/lha/huf.cpp @@ -18,7 +18,7 @@ #endif /* ------------------------------------------------------------------------ */ -unsigned short left[2 * NC - 1], right[2 * NC - 1]; +unsigned short h_left[2 * NC - 1], h_right[2 * NC - 1]; unsigned char c_len[NC], pt_len[NPT]; unsigned short c_freq[2 * NC - 1], c_table[4096], c_code[NC], p_freq[2 * NP - 1], pt_table[256], pt_code[NPT], t_freq[2 * NT - 1]; @@ -370,9 +370,9 @@ static void read_c_len(void) unsigned short mask = 1 << (16 - 9); do { if (lhabitbuf & mask) - c = right[c]; + c = h_right[c]; else - c = left[c]; + c = h_left[c]; mask >>= 1; } while (c >= NT); } @@ -416,9 +416,9 @@ unsigned short decode_c_st1(void) mask = 1 << (16 - 1); do { if (lhabitbuf & mask) - j = right[j]; + j = h_right[j]; else - j = left[j]; + j = h_left[j]; mask >>= 1; } while (j >= NC); fillbuf(c_len[j] - 12); @@ -439,9 +439,9 @@ unsigned short decode_p_st1(void) mask = 1 << (16 - 1); do { if (lhabitbuf & mask) - j = right[j]; + j = h_right[j]; else - j = left[j]; + j = h_left[j]; mask >>= 1; } while (j >= np); fillbuf(pt_len[j] - 8); diff --git a/archivers/lha/lha.h b/archivers/lha/lha.h index 34a123c0..6e41db14 100644 --- a/archivers/lha/lha.h +++ b/archivers/lha/lha.h @@ -173,7 +173,7 @@ EXTERN int prev_char; /* huf.c */ #ifndef LHA_MAIN_SRC /* t.okamoto 96/2/20 */ -EXTERN unsigned short left[], right[]; +EXTERN unsigned short h_left[], h_right[]; EXTERN unsigned char c_len[], pt_len[]; EXTERN unsigned short c_freq[], c_table[], c_code[]; EXTERN unsigned short p_freq[], pt_table[], pt_code[], t_freq[]; diff --git a/archivers/lha/lhamaketbl.cpp b/archivers/lha/lhamaketbl.cpp index 791636b9..f32b42e0 100644 --- a/archivers/lha/lhamaketbl.cpp +++ b/archivers/lha/lhamaketbl.cpp @@ -72,13 +72,13 @@ void lha_make_table(short nchar, unsigned char bitlen[], short tablebits, unsign /* make tree (n length) */ while (--n >= 0) { if (*p == 0) { - right[avail] = left[avail] = 0; + h_right[avail] = h_left[avail] = 0; *p = avail++; } if (i & 0x8000) - p = &right[*p]; + p = &h_right[*p]; else - p = &left[*p]; + p = &h_left[*p]; i <<= 1; } *p = j; diff --git a/archivers/lha/shuf.cpp b/archivers/lha/shuf.cpp index 62e9b1aa..e9102cfc 100644 --- a/archivers/lha/shuf.cpp +++ b/archivers/lha/shuf.cpp @@ -16,7 +16,7 @@ #define NP2 (NP * 2 - 1) /* ------------------------------------------------------------------------ */ static unsigned int np; -int fixed[2][16] = { +static int h_fixed[2][16] = { {3, 0x01, 0x04, 0x0c, 0x18, 0x30, 0}, /* old compatible */ {2, 0x01, 0x01, 0x03, 0x06, 0x0D, 0x1F, 0x4E, 0} /* 8K buf */ }; @@ -54,7 +54,7 @@ static void ready_made(int method) unsigned int code, weight; int *tbl; - tbl = fixed[method]; + tbl = h_fixed[method]; j = *tbl++; weight = 1 << (16 - j); code = 0; @@ -167,9 +167,9 @@ unsigned short decode_c_st0(void) i = lhabitbuf; do { if ((short) i < 0) - j = right[j]; + j = h_right[j]; else - j = left[j]; + j = h_left[j]; i <<= 1; } while (j >= N1); fillbuf(c_len[j] - 12); @@ -193,9 +193,9 @@ unsigned short decode_p_st0(void) i = lhabitbuf; do { if ((short) i < 0) - j = right[j]; + j = h_right[j]; else - j = left[j]; + j = h_left[j]; i <<= 1; } while (j >= np); fillbuf(pt_len[j] - 8); diff --git a/cfgfile.cpp b/cfgfile.cpp index 074a9cfa..cfc32a22 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -748,7 +748,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_dwrite (f, L"gfx_gamma", L"%d", p->gfx_gamma); cfgfile_dwrite_str (f, L"gfx_filter_mask", p->gfx_filtermask); if (p->gfx_filteroverlay[0]) { - cfgfile_dwrite (f, L"gfx_filter_overlay", L"%s:%d%s,%d%s,%d%s,%d%s", + cfgfile_dwrite (f, L"gfx_filter_overlay", L"%s,%d%s,%d%s,%d%s,%d%s", p->gfx_filteroverlay, p->gfx_filteroverlay_pos.x >= -24000 ? p->gfx_filteroverlay_pos.x : -p->gfx_filteroverlay_pos.x - 30000, p->gfx_filteroverlay_pos.x >= -24000 ? L"" : L"%", @@ -1275,7 +1275,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) #ifdef GFXFILTER if (_tcscmp (option, L"gfx_filter_overlay") == 0) { - TCHAR *s = _tcschr (value, ':'); + TCHAR *s = _tcschr (value, ','); p->gfx_filteroverlay_pos.x = 0; p->gfx_filteroverlay_pos.y = 0; p->gfx_filteroverlay_pos.width = 0; diff --git a/include/sysdeps.h b/include/sysdeps.h index e500a366..4830721f 100644 --- a/include/sysdeps.h +++ b/include/sysdeps.h @@ -15,6 +15,10 @@ * Copyright 1996, 1997 Bernd Schmidt */ +#include + +using namespace std; + #include #include #include diff --git a/readcpu.cpp b/readcpu.cpp index 5a1cdfea..f8448cd2 100644 --- a/readcpu.cpp +++ b/readcpu.cpp @@ -783,7 +783,7 @@ void read_table68k (void) } } -static int mismatch; +static int imismatch; static void handle_merges (long int opcode) { @@ -838,20 +838,20 @@ static void handle_merges (long int opcode) || table68k[code].suse != table68k[opcode].suse || table68k[code].duse != table68k[opcode].duse) { - mismatch++; continue; + imismatch++; continue; } if (table68k[opcode].suse && (table68k[opcode].spos != table68k[code].spos || table68k[opcode].smode != table68k[code].smode || table68k[opcode].stype != table68k[code].stype)) { - mismatch++; continue; + imismatch++; continue; } if (table68k[opcode].duse && (table68k[opcode].dpos != table68k[code].dpos || table68k[opcode].dmode != table68k[code].dmode)) { - mismatch++; continue; + imismatch++; continue; } if (code != opcode) @@ -864,7 +864,7 @@ void do_merges (void) { long int opcode; int nr = 0; - mismatch = 0; + imismatch = 0; for (opcode = 0; opcode < 65536; opcode++) { if (table68k[opcode].handler != -1 || table68k[opcode].mnemo == i_ILLG) continue; @@ -876,5 +876,5 @@ void do_merges (void) int get_no_mismatches (void) { - return mismatch; + return imismatch; } -- 2.47.3