summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2016-10-18 01:42:22 +0300
committerIvan Maidanski <ivmai@mail.ru>2016-10-18 01:42:22 +0300
commit5b9a22b994075525bee89ad7d3e98afb00aeeb62 (patch)
tree5bb01f0d3eaa0cd2a8c72fb96b7b72f37a8c7476 /extra
parent3964267d6b18ec66f72aedba0993535303fe8066 (diff)
downloadbdwgc-5b9a22b994075525bee89ad7d3e98afb00aeeb62.tar.gz
Fix 'variable assigned a value that is never used' cppcheck style warnings
* dyn_load.c [USE_PROC_FOR_LIBRARIES] (GC_register_map_entries): Remove datastart local variable. * extra/AmigaOS.c [GC_AMIGA_DS] (GC_register_data_segments): Remove num local variable. * extra/MacOS.c (firstTime): Remove. * extra/MacOS.c (GC_MacTemporaryNewPtr): Do not define firstTime if SHARED_LIBRARY_BUILD. * extra/MacOS.c (GC_MacFreeTemporaryMemory): Do not define (and update) totalMemoryUsed if SHARED_LIBRARY_BUILD. * extra/msvc_dbg.c (GetDescriptionFromAddress): Do not assign size variable when its value no longer used.
Diffstat (limited to 'extra')
-rw-r--r--extra/AmigaOS.c5
-rw-r--r--extra/MacOS.c9
-rw-r--r--extra/msvc_dbg.c2
3 files changed, 7 insertions, 9 deletions
diff --git a/extra/AmigaOS.c b/extra/AmigaOS.c
index a1f24a80..e0cbbd74 100644
--- a/extra/AmigaOS.c
+++ b/extra/AmigaOS.c
@@ -72,9 +72,6 @@ ptr_t GC_get_main_stack_base()
BPTR myseglist;
ULONG *data;
- int num;
-
-
# ifdef __GNUC__
ULONG dataSegSize;
GC_bool found_segment = FALSE;
@@ -108,7 +105,6 @@ ptr_t GC_get_main_stack_base()
/* xoper hunks Shell Process */
- num=0;
for (data = (ULONG *)BADDR(myseglist); data != NULL;
data = (ULONG *)BADDR(data[0])) {
if (((ULONG) GC_register_data_segments < (ULONG) &data[1]) ||
@@ -121,7 +117,6 @@ ptr_t GC_get_main_stack_base()
GC_add_roots_inner((char *)&data[1],
((char *)&data[1]) + data[-1], FALSE);
}
- ++num;
} /* for */
# ifdef __GNUC__
if (!found_segment) {
diff --git a/extra/MacOS.c b/extra/MacOS.c
index 57c22482..ae0dd9f8 100644
--- a/extra/MacOS.c
+++ b/extra/MacOS.c
@@ -58,13 +58,14 @@ struct TemporaryMemoryBlock {
};
static TemporaryMemoryHandle theTemporaryMemory = NULL;
-static Boolean firstTime = true;
void GC_MacFreeTemporaryMemory(void);
Ptr GC_MacTemporaryNewPtr(size_t size, Boolean clearMemory)
{
+# if !defined(SHARED_LIBRARY_BUILD)
static Boolean firstTime = true;
+# endif
OSErr result;
TemporaryMemoryHandle tempMemBlock;
Ptr tempPtr = nil;
@@ -119,11 +120,15 @@ void GC_MacFreeTemporaryMemory()
# endif
if (theTemporaryMemory != NULL) {
+# if !defined(SHARED_LIBRARY_BUILD)
long totalMemoryUsed = 0;
+# endif
TemporaryMemoryHandle tempMemBlock = theTemporaryMemory;
while (tempMemBlock != NULL) {
TemporaryMemoryHandle nextBlock = (**tempMemBlock).nextBlock;
+# if !defined(SHARED_LIBRARY_BUILD)
totalMemoryUsed += GetHandleSize((Handle)tempMemBlock);
+# endif
DisposeHandle((Handle)tempMemBlock);
tempMemBlock = nextBlock;
}
@@ -132,7 +137,7 @@ void GC_MacFreeTemporaryMemory()
# if !defined(SHARED_LIBRARY_BUILD)
if (GC_print_stats) {
fprintf(stdout, "[total memory used: %ld bytes.]\n",
- totalMemoryUsed);
+ totalMemoryUsed);
fprintf(stdout, "[total collections: %lu]\n",
(unsigned long)GC_gc_no);
}
diff --git a/extra/msvc_dbg.c b/extra/msvc_dbg.c
index 659bb32f..4862a599 100644
--- a/extra/msvc_dbg.c
+++ b/extra/msvc_dbg.c
@@ -342,8 +342,6 @@ size_t GetDescriptionFromAddress(void* address, const char* format,
size = (GC_ULONG_PTR)end < (GC_ULONG_PTR)buffer ? 0 : end - buffer;
buffer += GetModuleNameFromAddress(address, buffer, size);
- size = (GC_ULONG_PTR)end < (GC_ULONG_PTR)buffer ? 0 : end - buffer;
-
return buffer - begin;
}