You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2015/01/07 03:24:42 UTC
trafficserver git commit: Remove some unused code,
which has Coverity warnings
Repository: trafficserver
Updated Branches:
refs/heads/master 8bbf6a784 -> 8bc71f82b
Remove some unused code, which has Coverity warnings
Coverity CID #1021849
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8bc71f82
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8bc71f82
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8bc71f82
Branch: refs/heads/master
Commit: 8bc71f82b1a2e590b9065d217eb3daa45702c070
Parents: 8bbf6a7
Author: Leif Hedstrom <zw...@apache.org>
Authored: Tue Jan 6 18:46:20 2015 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Jan 6 18:48:42 2015 -0700
----------------------------------------------------------------------
proxy/CoreUtils.cc | 70 -------------------------------------------------
proxy/CoreUtils.h | 29 --------------------
2 files changed, 99 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8bc71f82/proxy/CoreUtils.cc
----------------------------------------------------------------------
diff --git a/proxy/CoreUtils.cc b/proxy/CoreUtils.cc
index 9723c39..89e7a1a 100644
--- a/proxy/CoreUtils.cc
+++ b/proxy/CoreUtils.cc
@@ -77,12 +77,6 @@
* +-----------------+ +-----------------+
*/
-/*
- PORTING ISSUES:
- read_core_memory read_core_memory II read_heap_header not used
- -> figure out some way to make print_netstate useful!
-*/
-
/* 32-bit arguments are pushed down stack in reverse syntactic order (hence accessed/popped in the right order), above the 32-bit near return address. %ebp, %esi, %edi, %ebx are callee-saved, other registers are caller-saved; %eax is to hold the result, or %edx:%eax for 64-bit results */
/* has -fomit-frame-pointer has any repercussions??
@@ -213,48 +207,6 @@ CoreUtils::insert_table(intptr_t vaddr1, intptr_t offset1, intptr_t fsize1)
}
-// returns -1 if not found in table or fills the buffer with characters
-// from the beginning of the memory section
-intptr_t
-CoreUtils::read_core_memory(intptr_t vaddr, intptr_t length, char *buf, FILE * fp)
-{
- intptr_t index = find_vaddr(vaddr, arrayMem.length(), 0);
- if (inTable == false)
- return -1;
- else {
- intptr_t offset = arrayMem[index].offset;
-
- if (fseek(fp, offset, SEEK_SET) != -1) {
- for (int j = 0; j < length; j++) {
- *buf++ = (char) getc(fp);
- }
- }
- return 1;
- }
-}
-
-// returns -1 if not found in table or fills the buffer with characters
-// from the beginning of the memory section + offset
-intptr_t
-CoreUtils::read_core_memory(intptr_t offset, intptr_t vaddr, intptr_t length, char *buf, FILE * fp)
-{
- intptr_t index = find_vaddr(vaddr, arrayMem.length(), 0);
-
- if (inTable == false)
- return -1;
- else {
- intptr_t offset2 = arrayMem[index].offset;
-
- if (fseek(fp, offset2 + offset, SEEK_SET) != -1) {
- for (int j = 0; j < length; j++) {
- *buf++ = (char) getc(fp);
- }
- }
- return 1;
- }
-}
-
-
// returns -1 on failure otherwise fills the buffer and
// returns the number of bytes read
intptr_t
@@ -785,28 +737,6 @@ CoreUtils::dump_history(HttpSM * hsm)
printf("-------- End History -----------\n\n");
}
-intptr_t
-CoreUtils::read_heap_header(intptr_t vaddr, intptr_t bytes, HdrHeap h)
-{
- intptr_t index = find_vaddr(vaddr, arrayMem.length(), 0);
- intptr_t vadd = arrayMem[index - 1].vaddr;
- intptr_t offset = arrayMem[index - 1].offset;
- intptr_t size = arrayMem[index - 1].fsize;
- intptr_t offset2 = std::abs(vaddr - vadd);
-
- if (bytes > (size - offset2))
- return -1;
- else {
- if (fseek(fp, offset2 + offset, SEEK_SET) != -1) {
- if (fread(&h, sizeof(HdrHeap), 1, fp) > 0)
- return bytes;
- else
- return -1;
- }
- }
- return -1;
-}
-
void
CoreUtils::process_EThread(EThread * eth_test)
{
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8bc71f82/proxy/CoreUtils.h
----------------------------------------------------------------------
diff --git a/proxy/CoreUtils.h b/proxy/CoreUtils.h
index fe16f68..a490e59 100644
--- a/proxy/CoreUtils.h
+++ b/proxy/CoreUtils.h
@@ -117,22 +117,6 @@ public:
static void insert_table(intptr_t vaddr1, intptr_t offset1, intptr_t fsize1);
/**********************************************************************
- * purpose: fills the given buffer with characters from the beginning
- * of the given memory section
- * inputs: int vaddr, int length, char* buf, FILE *fp
- * outputs: returns -1 on read error or 1 if successful
- **********************************************************************/
- static intptr_t read_core_memory(intptr_t vaddr, intptr_t length, char *buf, FILE * fp);
-
- /**********************************************************************
- * purpose: fills the given buffer with characters from the beginning
- * of the given memory section + given offset
- * inputs: int offset, int vaddr, int length, char* buf, FILE *fp
- * outputs: returns -1 on read error or 1 if successful
- **********************************************************************/
- static intptr_t read_core_memory(intptr_t offset, intptr_t vaddr, intptr_t length, char *buf, FILE * fp);
-
- /**********************************************************************
* purpose: fills the buffer with num of given bytes from the
* beginning of the memory section
* inputs: int vaddr, int bytes, char* buf
@@ -141,19 +125,6 @@ public:
static intptr_t read_from_core(intptr_t vaddr, intptr_t bytes, char *buf);
/**********************************************************************
- * purpose: beats the heck outta me
- * inputs: int vaddr, int bytes, HdrHeap h
- * outputs: returns -1 on read error or num of bytes read
- **********************************************************************/
- static intptr_t read_heap_header(intptr_t vaddr, intptr_t bytes, HdrHeap h);
-
- /**********************************************************************
- * purpose: returns the active lwp id
- * inputs: none
- * outputs: returns the active lwp id
- **********************************************************************/
-
- /**********************************************************************
* purpose: returns the base core_stack_state for the given thread id
* inputs: int threadId, core_stack_state* coress
* outputs: returns the base core_stack_state for the given thread id