From: Francesco Chemolli Date: Tue, 17 Nov 2009 10:07:53 +0000 (+0100) Subject: Fixed some cases of linkage type mismatch and parameter shadowing X-Git-Tag: SQUID_3_2_0_1~571 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e4ae841bb56fc39cf350c84d1aa04146f7bd808d;p=thirdparty%2Fsquid.git Fixed some cases of linkage type mismatch and parameter shadowing --- diff --git a/src/DiskIO/DiskDaemon/diskd.cc b/src/DiskIO/DiskDaemon/diskd.cc index d5703107ed..0a48f96b5e 100644 --- a/src/DiskIO/DiskDaemon/diskd.cc +++ b/src/DiskIO/DiskDaemon/diskd.cc @@ -302,11 +302,13 @@ fsHash(const void *key, unsigned int n) return (*k & (--n)); } +SQUIDCEXTERN { static void alarm_handler(int sig) { (void) 0; } +}; int main(int argc, char *argv[]) diff --git a/src/StoreMeta.cc b/src/StoreMeta.cc index 0211d1973d..4065a4854c 100644 --- a/src/StoreMeta.cc +++ b/src/StoreMeta.cc @@ -101,10 +101,10 @@ const int StoreMeta::MinimumTLVLength = 0; const int StoreMeta::MaximumTLVLength = 1 << 16; bool -StoreMeta::validLength(int length) const +StoreMeta::validLength(int aLength) const { - if (!IntRange (MinimumTLVLength, MaximumTLVLength).includes(length)) { - debugs(20, 0, "storeSwapMetaUnpack: insane length (" << length << ")!"); + if (!IntRange (MinimumTLVLength, MaximumTLVLength).includes(aLength)) { + debugs(20, 0, "storeSwapMetaUnpack: insane length (" << aLength << ")!"); return false; } diff --git a/src/acl/Ip.cc b/src/acl/Ip.cc index 95545bd8d6..b67a679fe4 100644 --- a/src/acl/Ip.cc +++ b/src/acl/Ip.cc @@ -508,10 +508,10 @@ ACLIP::parse() while (q != NULL) { /* pop each result off the list and add it to the data tree individually */ - acl_ip_data *next = q->next; + acl_ip_data *next_node = q->next; q->next = NULL; data = data->insert(q, acl_ip_data::NetworkCompare); - q = next; + q = next_node; } } } diff --git a/src/auth/negotiate/auth_negotiate.cc b/src/auth/negotiate/auth_negotiate.cc index 01c2f713ba..78eb37b73d 100644 --- a/src/auth/negotiate/auth_negotiate.cc +++ b/src/auth/negotiate/auth_negotiate.cc @@ -660,7 +660,7 @@ AuthNegotiateUserRequest::authenticated() const } void -AuthNegotiateUserRequest::authenticate(HttpRequest * request, ConnStateData * conn, http_hdr_type type) +AuthNegotiateUserRequest::authenticate(HttpRequest * aRequest, ConnStateData * conn, http_hdr_type type) { const char *proxy_auth, *blob; @@ -694,7 +694,7 @@ AuthNegotiateUserRequest::authenticate(HttpRequest * request, ConnStateData * co } /* get header */ - proxy_auth = request->header.getStr(type); + proxy_auth = aRequest->header.getStr(type); /* locate second word */ blob = proxy_auth; @@ -722,8 +722,8 @@ AuthNegotiateUserRequest::authenticate(HttpRequest * request, ConnStateData * co assert(conn->auth_user_request == NULL); conn->auth_user_request = this; AUTHUSERREQUESTLOCK(conn->auth_user_request, "conn"); - this->request = request; - HTTPMSGLOCK(this->request); + request = aRequest; + HTTPMSGLOCK(request); return; break; @@ -743,10 +743,10 @@ AuthNegotiateUserRequest::authenticate(HttpRequest * request, ConnStateData * co client_blob = xstrdup (blob); - if (this->request) - HTTPMSGUNLOCK(this->request); - this->request = request; - HTTPMSGLOCK(this->request); + if (request) + HTTPMSGUNLOCK(request); + request = aRequest; + HTTPMSGLOCK(request); return; break; diff --git a/src/auth/ntlm/auth_ntlm.cc b/src/auth/ntlm/auth_ntlm.cc index bc1cb5e12b..003f9ebab9 100644 --- a/src/auth/ntlm/auth_ntlm.cc +++ b/src/auth/ntlm/auth_ntlm.cc @@ -577,7 +577,7 @@ AuthNTLMUserRequest::authenticated() const } void -AuthNTLMUserRequest::authenticate(HttpRequest * request, ConnStateData * conn, http_hdr_type type) +AuthNTLMUserRequest::authenticate(HttpRequest * aRequest, ConnStateData * conn, http_hdr_type type) { const char *proxy_auth, *blob; @@ -611,7 +611,7 @@ AuthNTLMUserRequest::authenticate(HttpRequest * request, ConnStateData * conn, h } /* get header */ - proxy_auth = request->header.getStr(type); + proxy_auth = aRequest->header.getStr(type); /* locate second word */ blob = proxy_auth; @@ -640,8 +640,8 @@ AuthNTLMUserRequest::authenticate(HttpRequest * request, ConnStateData * conn, h assert(conn->auth_user_request == NULL); conn->auth_user_request = this; AUTHUSERREQUESTLOCK(conn->auth_user_request, "conn"); - this->request = request; - HTTPMSGLOCK(this->request); + request = aRequest; + HTTPMSGLOCK(request); return; break; @@ -661,10 +661,10 @@ AuthNTLMUserRequest::authenticate(HttpRequest * request, ConnStateData * conn, h client_blob = xstrdup (blob); - if (this->request) - HTTPMSGUNLOCK(this->request); - this->request = request; - HTTPMSGLOCK(this->request); + if (request) + HTTPMSGUNLOCK(request); + request = aRequest; + HTTPMSGLOCK(request); return; break; diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 9e0c675eb8..848c89912e 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -126,11 +126,11 @@ clientReplyContext::removeStoreReference(store_client ** scp, StoreEntry ** ep) { StoreEntry *e; - store_client *sc = *scp; + store_client *sc_tmp = *scp; if ((e = *ep) != NULL) { *ep = NULL; - storeUnregister(sc, e, this); + storeUnregister(sc_tmp, e, this); *scp = NULL; e->unlock(); } diff --git a/src/comm.cc b/src/comm.cc index 1319eccdda..3917b9514c 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -265,7 +265,7 @@ private: typedef enum { COMM_CB_READ = 1, - COMM_CB_DERIVED, + COMM_CB_DERIVED } comm_callback_t; struct _fd_debug_t { diff --git a/src/fs/ufs/store_dir_ufs.cc b/src/fs/ufs/store_dir_ufs.cc index 1f40f900aa..70ce7af7fe 100644 --- a/src/fs/ufs/store_dir_ufs.cc +++ b/src/fs/ufs/store_dir_ufs.cc @@ -108,7 +108,7 @@ UFSSwapDir::parseSizeL1L2() */ void -UFSSwapDir::reconfigure(int index, char *path) +UFSSwapDir::reconfigure(int aIndex, char *aPath) { parseSizeL1L2(); parseOptions(1); @@ -490,50 +490,50 @@ UFSSwapDir::swapSubDir(int subdirn)const } int -UFSSwapDir::createDirectory(const char *path, int should_exist) +UFSSwapDir::createDirectory(const char *aPath, int should_exist) { int created = 0; struct stat st; getCurrentTime(); - if (0 == ::stat(path, &st)) { + if (0 == ::stat(aPath, &st)) { if (S_ISDIR(st.st_mode)) { - debugs(47, (should_exist ? 3 : 1), path << " exists"); + debugs(47, (should_exist ? 3 : 1), aPath << " exists"); } else { - fatalf("Swap directory %s is not a directory.", path); + fatalf("Swap directory %s is not a directory.", aPath); } #ifdef _SQUID_MSWIN_ - } else if (0 == mkdir(path)) { + } else if (0 == mkdir(aPath)) { #else - } else if (0 == mkdir(path, 0755)) { + } else if (0 == mkdir(aPath, 0755)) { #endif - debugs(47, (should_exist ? 1 : 3), path << " created"); + debugs(47, (should_exist ? 1 : 3), aPath << " created"); created = 1; } else { fatalf("Failed to make swap directory %s: %s", - path, xstrerror()); + aPath, xstrerror()); } return created; } bool -UFSSwapDir::pathIsDirectory(const char *path)const +UFSSwapDir::pathIsDirectory(const char *aPath)const { struct stat sb; - if (::stat(path, &sb) < 0) { - debugs(47, 0, "" << path << ": " << xstrerror()); + if (::stat(aPath, &sb) < 0) { + debugs(47, 0, "" << aPath << ": " << xstrerror()); return false; } if (S_ISDIR(sb.st_mode) == 0) { - debugs(47, 0, "" << path << " is not a directory"); + debugs(47, 0, "" << aPath << " is not a directory"); return false; } @@ -687,7 +687,7 @@ UFSSwapDir::addDiskRestore(const cache_key * key, time_t lastref, time_t lastmod, u_int32_t refcount, - u_int16_t flags, + u_int16_t newFlags, int clean) { StoreEntry *e = NULL; @@ -708,7 +708,7 @@ UFSSwapDir::addDiskRestore(const cache_key * key, e->expires = expires; e->lastmod = lastmod; e->refcount = refcount; - e->flags = flags; + e->flags = newFlags; EBIT_SET(e->flags, ENTRY_CACHABLE); EBIT_CLR(e->flags, RELEASE_REQUEST); EBIT_CLR(e->flags, KEY_PRIVATE); @@ -1389,10 +1389,10 @@ StoreSearchUFS::~StoreSearchUFS() } void -StoreSearchUFS::next(void (callback)(void *cbdata), void *cbdata) +StoreSearchUFS::next(void (aCallback)(void *cbdata), void *aCallbackArgs) { next(); - callback (cbdata); + aCallback(aCallbackArgs); } bool diff --git a/src/fs/ufs/store_io_ufs.cc b/src/fs/ufs/store_io_ufs.cc index 1f86970dee..9b374e7f6d 100644 --- a/src/fs/ufs/store_io_ufs.cc +++ b/src/fs/ufs/store_io_ufs.cc @@ -198,22 +198,22 @@ UFSStoreState::close() } void -UFSStoreState::read_(char *buf, size_t size, off_t offset, STRCB * callback, void *callback_data) +UFSStoreState::read_(char *buf, size_t size, off_t offset, STRCB * aCallback, void *aCallbackData) { assert(read.callback == NULL); assert(read.callback_data == NULL); assert(!reading); assert(!closing); - assert (callback); + assert (aCallback); if (!theFile->canRead()) { debugs(79, 3, "UFSStoreState::read_: queueing read because theFile can't read"); - queueRead (buf, size, offset, callback, callback_data); + queueRead (buf, size, offset, aCallback, aCallbackData); return; } - read.callback = callback; - read.callback_data = cbdataReference(callback_data); + read.callback = aCallback; + read.callback_data = cbdataReference(aCallbackData); debugs(79, 3, "UFSStoreState::read_: dirno " << swap_dirn << ", fileno "<< std::setfill('0') << std::hex << std::uppercase << std::setw(8) << swap_filen); offset_ = offset; @@ -311,9 +311,9 @@ UFSStoreState::readCompleted(const char *buf, int len, int errflag, RefCount 0) offset_ += len; - STRCB *callback = read.callback; + STRCB *callback_ = read.callback; - assert(callback); + assert(callback_); read.callback = NULL; @@ -335,7 +335,7 @@ UFSStoreState::readCompleted(const char *buf, int len, int errflag, RefCount 0 && read_buf != buf) memcpy(read_buf, buf, len); - callback(cbdata, read_buf, len, this); + callback_(cbdata, read_buf, len, this); } if (flags.try_closing || (theFile != NULL && theFile->error()) ) @@ -461,7 +461,7 @@ UFSStoreState::kickReadQueue() } void -UFSStoreState::queueRead(char *buf, size_t size, off_t offset, STRCB *callback, void *callback_data) +UFSStoreState::queueRead(char *buf, size_t size, off_t offset, STRCB *callback_, void *callback_data_) { debugs(79, 3, "UFSStoreState::queueRead: queueing read"); assert(opening); @@ -470,8 +470,8 @@ UFSStoreState::queueRead(char *buf, size_t size, off_t offset, STRCB *callback, q->buf = buf; q->size = size; q->offset = offset; - q->callback = callback; - q->callback_data = cbdataReference(callback_data); + q->callback = callback_; + q->callback_data = cbdataReference(callback_data_); linklistPush(&pending_reads, q); } diff --git a/src/fs/ufs/ufscommon.cc b/src/fs/ufs/ufscommon.cc index 20fe3679c5..d994e97d0a 100644 --- a/src/fs/ufs/ufscommon.cc +++ b/src/fs/ufs/ufscommon.cc @@ -785,7 +785,7 @@ RebuildState::getNextFile(sfileno * filn_p, int *size) } void -RebuildState::next(void (callback)(void *cbdata), void *cbdata) +RebuildState::next(void (aCallback)(void *aCallbackDataarg), void *aCallbackData) { /* for now, we don't cache at all */ speed = 1; @@ -794,7 +794,7 @@ RebuildState::next(void (callback)(void *cbdata), void *cbdata) while (!isDone() && currentEntry() == NULL) rebuildStep(); - callback(cbdata); + aCallback(aCallbackData); } bool diff --git a/src/mem.cc b/src/mem.cc index 334304506b..226712b880 100644 --- a/src/mem.cc +++ b/src/mem.cc @@ -504,7 +504,7 @@ memInUse(mem_type type) /* ick */ -static void +void memFree2K(void *p) { memFree(p, MEM_2K_BUF); @@ -522,19 +522,19 @@ memFree8K(void *p) memFree(p, MEM_8K_BUF); } -static void +void memFree16K(void *p) { memFree(p, MEM_16K_BUF); } -static void +void memFree32K(void *p) { memFree(p, MEM_32K_BUF); } -static void +void memFree64K(void *p) { memFree(p, MEM_64K_BUF); diff --git a/src/protos.h b/src/protos.h index 46f5ba3739..4493fa2003 100644 --- a/src/protos.h +++ b/src/protos.h @@ -87,7 +87,7 @@ SQUIDCEXTERN void clientdbInit(void); SQUIDCEXTERN void clientdbUpdate(const IpAddress &, log_type, protocol_t, size_t); SQUIDCEXTERN int clientdbCutoffDenied(const IpAddress &); -SQUIDCEXTERN void clientdbDump(StoreEntry *); +void clientdbDump(StoreEntry *); SQUIDCEXTERN void clientdbFreeMemory(void); SQUIDCEXTERN int clientdbEstablished(const IpAddress &, int); @@ -472,8 +472,12 @@ SQUIDCEXTERN void *memAllocString(size_t net_size, size_t * gross_size); SQUIDCEXTERN void *memAllocBuf(size_t net_size, size_t * gross_size); SQUIDCEXTERN void *memReallocBuf(void *buf, size_t net_size, size_t * gross_size); SQUIDCEXTERN void memFree(void *, int type); -SQUIDCEXTERN void memFree4K(void *); -SQUIDCEXTERN void memFree8K(void *); +void memFree2K(void *); +void memFree4K(void *); +void memFree8K(void *); +void memFree16K(void *); +void memFree32K(void *); +void memFree64K(void *); SQUIDCEXTERN void memFreeString(size_t size, void *); SQUIDCEXTERN void memFreeBuf(size_t size, void *); SQUIDCEXTERN FREE *memFreeBufFunc(size_t size);