lib, nvcuda: Fix warnings from cppcheck reported by Toralf Förster.

This commit is contained in:
Charlie Fenton 2014-03-20 05:20:04 -07:00
parent 0355298b0d
commit 3637e0f6da
3 changed files with 6 additions and 4 deletions

View File

@ -313,8 +313,8 @@ static int ImageListForTaskOldWithNames(
QTMAddr listChunkAddr; QTMAddr listChunkAddr;
QTMAddr elemSizeAddr; QTMAddr elemSizeAddr;
QTMAddr elemCountAddr; QTMAddr elemCountAddr;
uint32_t elemCount; uint32_t elemCount = 0;
uint32_t elemSize; uint32_t elemSize = 0;
size_t listChunkSize; size_t listChunkSize;
enum { // constants related to the array elements enum { // constants related to the array elements
kValidOffset = 12, // offset to "valid" field kValidOffset = 12, // offset to "valid" field

View File

@ -116,7 +116,7 @@ int procinfo_setup(PROC_MAP& pm) {
while (1) { while (1) {
p.clear(); p.clear();
c = fscanf(fd, "%d%d%d%d%ld%d%d:%lf ", c = fscanf(fd, "%d%d%d%d%lu%d%d:%lf ",
&p.id, &p.id,
&p.parentid, &p.parentid,
&real_mem, &real_mem,

View File

@ -61,6 +61,7 @@ int main(int argc, char** argv) {
REAL* h_idata; REAL* h_idata;
MFILE out; MFILE out;
FILE* state, *infile; FILE* state, *infile;
double num=0;
generate_random_input_file(MATRIX_SIZE); //call this if you don't want to generate_random_input_file(MATRIX_SIZE); //call this if you don't want to
//construct the input file manually //construct the input file manually
@ -111,7 +112,8 @@ int main(int argc, char** argv) {
fscanf(state,"%d",&dimension); fscanf(state,"%d",&dimension);
cudaMallocHost((void **)&h_idata,dimension*dimension*sizeof(REAL)); cudaMallocHost((void **)&h_idata,dimension*dimension*sizeof(REAL));
for (int i=0;i<dimension*dimension;++i) { for (int i=0;i<dimension*dimension;++i) {
fscanf(state, "%lf", &h_idata[i]); fscanf(state, "%lf", &num);
h_idata[i] = num;
} }
} }
fclose(state); fclose(state);