Skip to content

Commit

Permalink
Fixing compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
TomTheBear committed Dec 16, 2019
1 parent 3795eff commit 89d1fed
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bench/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ $(BUILD_DIR):
#PATTERN RULES
$(BUILD_DIR)/%.o: %.c
@echo "===> COMPILE C $@"
$(Q)$(CC) -g -c $(DEBUG_FLAGS) $(CFLAGS) $(ANSI_CFLAGS) $(CPPFLAGS) $(TARGET_LIB) $< -o $@
$(Q)$(CC) -g -c $(DEBUG_FLAGS) $(CFLAGS) $(ANSI_CFLAGS) $(CPPFLAGS) $< -o $@
$(Q)$(CC) -g $(DEBUG_FLAGS) $(CPPFLAGS) -MT $(@:.d=.o) -MM $< > $(BUILD_DIR)/$*.d


Expand Down
1 change: 1 addition & 0 deletions bench/includes/isa_armv8.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ int footer(struct bstrList* code, char* funcname)
bstrListAddChar(code, "#endif");

bdestroy(line);
return 0;
}

int loopheader(struct bstrList* code, char* loopname, int step)
Expand Down
2 changes: 1 addition & 1 deletion bench/src/ptt2asm.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ struct bstrList* dynbench_getall()
dp = ownopendir(bdata(path));
if (dp != NULL)
{
while (ep = readdir(dp))
while ((ep = readdir(dp)))
{
if (strncmp(&(ep->d_name[strlen(ep->d_name)-4]), ".ptt", 4) == 0)
{
Expand Down
4 changes: 3 additions & 1 deletion src/access-daemon/accessDaemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static int getNumberOfNumaNodes()
dp = opendir ("/sys/devices/system/node/");
if (dp != NULL)
{
while (ep = readdir (dp))
while ((ep = readdir (dp)))
{
if (fnmatch("node?*", ep->d_name, FNM_PATHNAME) == 0)
{
Expand Down Expand Up @@ -840,6 +840,8 @@ static int allowed_pci_skx(PciDeviceType type, uint32_t reg)
(reg == MSR_UNC_SKX_M3UPI_PMON_BOX_STATUS))
return 1;
break;
default:
break;
}
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions src/access-daemon/setFreqDaemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,8 @@ static int freq_read(FreqDataRecord *rec)
case FREQ_LOC_GOV:
read_fd = f->set_gov;
break;
default:
break;
}
if (read_fd < 0)
{
Expand Down
4 changes: 4 additions & 0 deletions src/frequency_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ static int freq_send_direct(FreqDataRecordType type, FreqDataRecordLocation loc,
lseek(fd, 0, SEEK_SET);
ret = read(fd, data, len);
break;
default:
break;
}
if (ret < 0)
return ret;
Expand Down Expand Up @@ -565,6 +567,8 @@ static int freq_send_client(FreqDataRecordType type, FreqDataRecordLocation loc,
case FREQ_ERR_UNKNOWN:
return -EBADF;
break;
default:
break;
}
return -1;
}
Expand Down
4 changes: 2 additions & 2 deletions src/ghash.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,10 @@ g_hash_table_remove(GHashTable *hash_table, gpointer key)
{
int* key_ptr = (int*)key;
int keyint = *key_ptr;
int idx = g_hash_table_lookup_node(hash_table, key_ptr, &hashret);
int idx = g_hash_table_lookup_node(hash_table, key_ptr, (guint*)&hashret);
g_hash_table_remove_node(hash_table, idx);

}
return 0;
}

static void
Expand Down
2 changes: 1 addition & 1 deletion src/includes/perfmon_ivybridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int perfmon_init_ivybridge(int cpu_id)
lock_acquire((int*) &socket_lock[affinity_thread2socket_lookup[cpu_id]], cpu_id);
lock_acquire((int*) &tile_lock[affinity_thread2core_lookup[cpu_id]], cpu_id);
HPMwrite(cpu_id, MSR_DEV, MSR_PEBS_ENABLE, 0x0ULL);
if ((cpuid_info.model == IVYBRIDGE_EP))
if (cpuid_info.model == IVYBRIDGE_EP)
{
ivy_cbox_setup = ivbep_cbox_setup;
ivb_did_cbox_test = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/includes/perfmon_sandybridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int perfmon_init_sandybridge(int cpu_id)
lock_acquire((int*) &tile_lock[affinity_thread2core_lookup[cpu_id]], cpu_id);
CHECK_MSR_WRITE_ERROR(HPMwrite(cpu_id, MSR_DEV, MSR_PEBS_ENABLE, 0x0ULL));

if ((cpuid_info.model == SANDYBRIDGE_EP))
if (cpuid_info.model == SANDYBRIDGE_EP)
{
sandy_cbox_setup = snbep_cbox_setup;
snb_did_cbox_test = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/includes/perfmon_skylake.h
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ int perfmon_setupCounterThread_skylake(
{
uint64_t flags = 0x0;
HPMread(cpu_id, MSR_DEV, TSX_FORCE_ABORT, &flags);
if (flags & 0x1 == 0)
if ((flags & 0x1) == 0)
{
fprintf(stderr, "Warning: Counter PMC3 cannot be used if Restricted Transactional Memory feature is enabled and\n");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)
Expand Down
3 changes: 2 additions & 1 deletion src/luawid.c
Original file line number Diff line number Diff line change
Expand Up @@ -1952,7 +1952,7 @@ parse(char *line, char **argv)
*line != '\t' && *line != '\n')
line++; /* skip the argument until ... */
}
*argv = '\0'; /* mark the end of argument list */
*argv = (char *)'\0'; /* mark the end of argument list */
}

/* ##### FUNCTION DEFINITIONS - LOCAL TO THIS SOURCE FILE ########### */
Expand Down Expand Up @@ -2355,6 +2355,7 @@ lua_likwid_resetRegion(lua_State* L)
{
const char* tag = (const char*)luaL_checkstring(L, -1);
lua_pushinteger(L, likwid_markerResetRegion(tag));
return 1;
}

static int
Expand Down
8 changes: 4 additions & 4 deletions src/perfgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ perfgroup_getGroups(
}
i = 0;
s = 0;
while (ep = readdir(dp))
while ((ep = readdir(dp)))
{
if (strncmp(&(ep->d_name[strlen(ep->d_name)-4]), ".txt", 4) == 0)
{
Expand All @@ -218,7 +218,7 @@ perfgroup_getGroups(
}
if (search_home)
{
while (ep = readdir(dp))
while ((ep = readdir(dp)))
{
if (strncmp(&(ep->d_name[strlen(ep->d_name)-4]), ".txt", 4) == 0)
{
Expand Down Expand Up @@ -296,7 +296,7 @@ perfgroup_getGroups(
i = 0;
int skip_group = 0;

while (ep = readdir(dp))
while ((ep = readdir(dp)))
{
if (strncmp(&(ep->d_name[strlen(ep->d_name)-4]), ".txt", 4) == 0)
{
Expand Down Expand Up @@ -444,7 +444,7 @@ perfgroup_getGroups(
else
{
dp = opendir(homepath);
while (ep = readdir(dp))
while ((ep = readdir(dp)))
{
if (strncmp(&(ep->d_name[strlen(ep->d_name)-4]), ".txt", 4) == 0)
{
Expand Down
8 changes: 4 additions & 4 deletions src/topology_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ proc_init_cpuFeatures(void)
setBit(cpuid_info.featureFlags, RDSEED);
bcatcstr(bfeatures, "RDSEED ");
}
else if ((bisstemeqblk(flaglist->entry[i], "avx512", 6) == 1) && (!testBit(cpuid_info.featureFlags, AVX512)))
else if ((bisstemeqblk(flaglist->entry[i], "avx512", 6) == 1) && (!(testBit(cpuid_info.featureFlags, AVX512))))
{
setBit(cpuid_info.featureFlags, AVX512);
bcatcstr(bfeatures, "AVX512 ");
Expand Down Expand Up @@ -564,7 +564,7 @@ proc_init_cpuFeatures(void)
}
}

if (testBit(cpuid_info.featureFlags, SSSE3) && !testBit(cpuid_info.featureFlags, SSE3))
if (testBit(cpuid_info.featureFlags, SSSE3) && (!(testBit(cpuid_info.featureFlags, SSE3))))
{
setBit(cpuid_info.featureFlags, SSE3);
bcatcstr(bfeatures, "SSE3 ");
Expand Down Expand Up @@ -682,7 +682,7 @@ void proc_split_llc_check(CacheLevel* llc_cache)
fprintf(stderr, "No NUMA support (no folder %s)\n", "/sys/devices/system/node");
return;
}
while (ep = readdir(dp))
while ((ep = readdir(dp)))
{
if (strncmp(ep->d_name, "node", 4) == 0)
{
Expand All @@ -696,7 +696,7 @@ void proc_split_llc_check(CacheLevel* llc_cache)
fprintf(stderr, "No NUMA support (no folder %s)\n", "/sys/devices/system/node/node0/");
return;
}
while (ep = readdir(dp))
while ((ep = readdir(dp)))
{
if (strncmp(ep->d_name, "cpu", 3) == 0 &&
ep->d_name[strlen(ep->d_name)-1] >= '0' &&
Expand Down

0 comments on commit 89d1fed

Please sign in to comment.