From 3637e0f6da6e396bf902fc3c96709875b119e636 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Thu, 20 Mar 2014 05:20:04 -0700 Subject: [PATCH] =?UTF-8?q?lib,=20nvcuda:=20Fix=20warnings=20from=20cppche?= =?UTF-8?q?ck=20reported=20by=20Toralf=20F=C3=B6rster.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mac/QMachOImageList.c | 4 ++-- lib/procinfo_mac.cpp | 2 +- samples/nvcuda/cuda.cpp | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/mac/QMachOImageList.c b/lib/mac/QMachOImageList.c index 43e60970a6..0044c114d4 100644 --- a/lib/mac/QMachOImageList.c +++ b/lib/mac/QMachOImageList.c @@ -313,8 +313,8 @@ static int ImageListForTaskOldWithNames( QTMAddr listChunkAddr; QTMAddr elemSizeAddr; QTMAddr elemCountAddr; - uint32_t elemCount; - uint32_t elemSize; + uint32_t elemCount = 0; + uint32_t elemSize = 0; size_t listChunkSize; enum { // constants related to the array elements kValidOffset = 12, // offset to "valid" field diff --git a/lib/procinfo_mac.cpp b/lib/procinfo_mac.cpp index 9e3d5d7a5b..705c534c6b 100644 --- a/lib/procinfo_mac.cpp +++ b/lib/procinfo_mac.cpp @@ -116,7 +116,7 @@ int procinfo_setup(PROC_MAP& pm) { while (1) { 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.parentid, &real_mem, diff --git a/samples/nvcuda/cuda.cpp b/samples/nvcuda/cuda.cpp index 5a15eafc1d..2dc740c0b4 100644 --- a/samples/nvcuda/cuda.cpp +++ b/samples/nvcuda/cuda.cpp @@ -61,6 +61,7 @@ int main(int argc, char** argv) { REAL* h_idata; MFILE out; FILE* state, *infile; + double num=0; generate_random_input_file(MATRIX_SIZE); //call this if you don't want to //construct the input file manually @@ -111,7 +112,8 @@ int main(int argc, char** argv) { fscanf(state,"%d",&dimension); cudaMallocHost((void **)&h_idata,dimension*dimension*sizeof(REAL)); for (int i=0;i