Skip to content

Commit

Permalink
removed some unused vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Gray Watson committed Nov 25, 2020
1 parent c73b295 commit a2c89dc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
5 changes: 3 additions & 2 deletions chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -2344,12 +2344,14 @@ void *_dmalloc_chunk_malloc(const char *file, const unsigned int line,
const unsigned int alignment)
{
unsigned long needed_size;
int valloc_b = 0, memalign_b = 0, fence_b = 0;
int valloc_b = 0, fence_b = 0;
char where_buf[MAX_FILE_LENGTH + 64], disp_buf[64];
skip_alloc_t *slot_p;
pnt_info_t pnt_info;
const char *trans_log;

// TOTO: is alignment used here appropriately?

/* counts calls to malloc */
if (func_id == DMALLOC_FUNC_CALLOC) {
func_calloc_c++;
Expand All @@ -2360,7 +2362,6 @@ void *_dmalloc_chunk_malloc(const char *file, const unsigned int line,
}
else if (alignment > 0) {
func_memalign_c++;
memalign_b = 1;
}
else if (func_id == DMALLOC_FUNC_NEW) {
func_new_c++;
Expand Down
1 change: 0 additions & 1 deletion dmalloc_t.c
Original file line number Diff line number Diff line change
Expand Up @@ -3332,7 +3332,6 @@ static int check_special(void)
* Make sure that string tokens work in the processing program.
*/
{
unsigned int old_flags = dmalloc_debug_current();
unsigned int new_flags;

if (! silent_b) {
Expand Down
4 changes: 1 addition & 3 deletions error.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ static char message_str[1024]; /* message string buffer */
*/
static void build_logfile_path(char *buf, const int buf_len)
{
char *bounds_p;
char *path_p, *buf_p, *start_p;
char *bounds_p, *path_p, *buf_p;
int len;

if (dmalloc_logpath == NULL) {
Expand All @@ -159,7 +158,6 @@ static void build_logfile_path(char *buf, const int buf_len)
buf_p = buf;
bounds_p = buf + buf_len;

start_p = dmalloc_logpath;
for (path_p = dmalloc_logpath; *path_p != '\0'; path_p++) {

/* if we don't have to do anything special then just continue */
Expand Down
20 changes: 14 additions & 6 deletions malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1349,13 +1349,17 @@ char *strndup(const char *string, const DMALLOC_SIZE max_len)
DMALLOC_FREE_RET free(DMALLOC_PNT pnt)
{
char *file;
#if DMALLOC_FREE_RET == int
int ret;
#endif

GET_RET_ADDR(file);
ret = dmalloc_free(file, DMALLOC_DEFAULT_LINE, pnt, DMALLOC_FUNC_FREE);
#if DMALLOC_FREE_RET == int
ret =
#endif
dmalloc_free(file, DMALLOC_DEFAULT_LINE, pnt, DMALLOC_FUNC_FREE);

#if (defined(__STDC__) && __STDC__ == 1) || defined(__cplusplus) || defined(STDC_HEADERS)
#else
#if DMALLOC_FREE_RET == int
return ret;
#endif
}
Expand All @@ -1380,13 +1384,17 @@ DMALLOC_FREE_RET free(DMALLOC_PNT pnt)
DMALLOC_FREE_RET cfree(DMALLOC_PNT pnt)
{
char *file;
#if DMALLOC_FREE_RET == int
int ret;
#endif

GET_RET_ADDR(file);
ret = dmalloc_free(file, DMALLOC_DEFAULT_LINE, pnt, DMALLOC_FUNC_CFREE);
#if DMALLOC_FREE_RET == int
ret =
#endif
dmalloc_free(file, DMALLOC_DEFAULT_LINE, pnt, DMALLOC_FUNC_CFREE);

#if (defined(__STDC__) && __STDC__ == 1) || defined(__cplusplus) || defined(STDC_HEADERS)
#else
#if DMALLOC_FREE_RET == int
return ret;
#endif
}
Expand Down

0 comments on commit a2c89dc

Please sign in to comment.