Andrew Talbot : cabinet: Constify some variables.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Mar 15 08:19:23 CDT 2007
Module: wine
Branch: master
Commit: 5c812a14f30a4ab82b89d2b75273e90f098587e2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5c812a14f30a4ab82b89d2b75273e90f098587e2
Author: Andrew Talbot <Andrew.Talbot at talbotville.com>
Date: Wed Mar 14 23:09:28 2007 +0000
cabinet: Constify some variables.
---
dlls/cabinet/cabinet.h | 4 ++--
dlls/cabinet/cabinet_main.c | 4 ++--
dlls/cabinet/fci.c | 10 +++++-----
dlls/cabinet/fdi.c | 25 ++++++++++++-------------
4 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/dlls/cabinet/cabinet.h b/dlls/cabinet/cabinet.h
index 53744af..befa604 100644
--- a/dlls/cabinet/cabinet.h
+++ b/dlls/cabinet/cabinet.h
@@ -640,7 +640,7 @@ typedef struct {
/* from fdi.c */
void QTMupdatemodel(struct QTMmodel *model, int sym);
-int make_decode_table(cab_ULONG nsyms, cab_ULONG nbits, cab_UBYTE *length, cab_UWORD *table);
-cab_ULONG checksum(cab_UBYTE *data, cab_UWORD bytes, cab_ULONG csum);
+int make_decode_table(cab_ULONG nsyms, cab_ULONG nbits, const cab_UBYTE *length, cab_UWORD *table);
+cab_ULONG checksum(const cab_UBYTE *data, cab_UWORD bytes, cab_ULONG csum);
#endif /* __WINE_CABINET_H */
diff --git a/dlls/cabinet/cabinet_main.c b/dlls/cabinet/cabinet_main.c
index c37a449..2c21286 100644
--- a/dlls/cabinet/cabinet_main.c
+++ b/dlls/cabinet/cabinet_main.c
@@ -154,7 +154,7 @@ static long fdi_seek(INT_PTR hf, long dist, int seektype)
return SetFilePointer(handle, dist, NULL, seektype);
}
-static void fill_file_node(struct ExtractFileList *pNode, LPSTR szFilename)
+static void fill_file_node(struct ExtractFileList *pNode, LPCSTR szFilename)
{
pNode->next = NULL;
pNode->flag = FALSE;
@@ -163,7 +163,7 @@ static void fill_file_node(struct ExtractFileList *pNode, LPSTR szFilename)
lstrcpyA(pNode->filename, szFilename);
}
-static BOOL file_in_list(struct ExtractFileList *pNode, LPSTR szFilename)
+static BOOL file_in_list(const struct ExtractFileList *pNode, LPCSTR szFilename)
{
while (pNode)
{
diff --git a/dlls/cabinet/fci.c b/dlls/cabinet/fci.c
index 76ead07..112c06b 100644
--- a/dlls/cabinet/fci.c
+++ b/dlls/cabinet/fci.c
@@ -430,12 +430,12 @@ static BOOL fci_flush_data_block (HFCI hfci, int* err,
-static cab_ULONG fci_get_checksum(void *pv, UINT cb, CHECKSUM seed)
+static cab_ULONG fci_get_checksum(const void *pv, UINT cb, CHECKSUM seed)
{
- cab_ULONG csum;
- cab_ULONG ul;
- int cUlong;
- BYTE *pb;
+ cab_ULONG csum;
+ cab_ULONG ul;
+ int cUlong;
+ const BYTE *pb;
csum = seed;
cUlong = cb / 4;
diff --git a/dlls/cabinet/fdi.c b/dlls/cabinet/fdi.c
index 93b0ad2..6815d6d 100644
--- a/dlls/cabinet/fdi.c
+++ b/dlls/cabinet/fdi.c
@@ -220,7 +220,7 @@ void QTMupdatemodel(struct QTMmodel *model, int sym) {
* OK: 0
* error: 1
*/
-int make_decode_table(cab_ULONG nsyms, cab_ULONG nbits, cab_UBYTE *length, cab_UWORD *table) {
+int make_decode_table(cab_ULONG nsyms, cab_ULONG nbits, const cab_UBYTE *length, cab_UWORD *table) {
register cab_UWORD sym;
register cab_ULONG leaf;
register cab_UBYTE bit_num = 1;
@@ -293,7 +293,7 @@ int make_decode_table(cab_ULONG nsyms, cab_ULONG nbits, cab_UBYTE *length, cab_U
/*************************************************************************
* checksum (internal)
*/
-cab_ULONG checksum(cab_UBYTE *data, cab_UWORD bytes, cab_ULONG csum) {
+cab_ULONG checksum(const cab_UBYTE *data, cab_UWORD bytes, cab_ULONG csum) {
int len;
cab_ULONG ul = 0;
@@ -1132,16 +1132,16 @@ struct Ziphuft **t, cab_LONG *m, fdi_decomp_state *decomp_state)
/*********************************************************
* fdi_Zipinflate_codes (internal)
*/
-static cab_LONG fdi_Zipinflate_codes(struct Ziphuft *tl, struct Ziphuft *td,
+static cab_LONG fdi_Zipinflate_codes(const struct Ziphuft *tl, const struct Ziphuft *td,
cab_LONG bl, cab_LONG bd, fdi_decomp_state *decomp_state)
{
- register cab_ULONG e; /* table entry flag/number of extra bits */
- cab_ULONG n, d; /* length and index for copy */
- cab_ULONG w; /* current window position */
- struct Ziphuft *t; /* pointer to table entry */
- cab_ULONG ml, md; /* masks for bl and bd bits */
- register cab_ULONG b; /* bit buffer */
- register cab_ULONG k; /* number of bits in bit buffer */
+ register cab_ULONG e; /* table entry flag/number of extra bits */
+ cab_ULONG n, d; /* length and index for copy */
+ cab_ULONG w; /* current window position */
+ const struct Ziphuft *t; /* pointer to table entry */
+ cab_ULONG ml, md; /* masks for bl and bd bits */
+ register cab_ULONG b; /* bit buffer */
+ register cab_ULONG k; /* number of bits in bit buffer */
/* make local copies of globals */
b = ZIP(bb); /* initialize bit buffer */
@@ -1507,7 +1507,6 @@ static int QTMfdi_decomp(int inlen, int outlen, fdi_decomp_state *decomp_state)
cab_UBYTE *inpos = CAB(inbuf);
cab_UBYTE *window = QTM(window);
cab_UBYTE *runsrc, *rundest;
-
cab_ULONG window_posn = QTM(window_posn);
cab_ULONG window_size = QTM(window_size);
@@ -1677,7 +1676,7 @@ static int fdi_lzx_read_lens(cab_UBYTE *lens, cab_ULONG first, cab_ULONG last, s
*/
static int LZXfdi_decomp(int inlen, int outlen, fdi_decomp_state *decomp_state) {
cab_UBYTE *inpos = CAB(inbuf);
- cab_UBYTE *endinp = inpos + inlen;
+ const cab_UBYTE *endinp = inpos + inlen;
cab_UBYTE *window = LZX(window);
cab_UBYTE *runsrc, *rundest;
cab_UWORD *hufftbl; /* used in READ_HUFFSYM macro as chosen decoding table */
@@ -2007,7 +2006,7 @@ static int LZXfdi_decomp(int inlen, int outlen, fdi_decomp_state *decomp_state)
* is also where we jump to additional cabinets in the case of split
* cab's, and provide (some of) the NEXT_CABINET notification semantics.
*/
-static int fdi_decomp(struct fdi_file *fi, int savemode, fdi_decomp_state *decomp_state,
+static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state *decomp_state,
char *pszCabPath, PFNFDINOTIFY pfnfdin, void *pvUser)
{
cab_ULONG bytes = savemode ? fi->length : fi->offset - CAB(offset);
More information about the wine-cvs
mailing list