From patchwork Tue Feb 17 07:44:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Gaisler X-Patchwork-Id: 5108 Received: (qmail 32532 invoked by alias); 17 Feb 2015 07:45:37 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 32284 invoked by uid 89); 17 Feb 2015 07:45:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: bin-vsp-out-01.atm.binero.net Received: from vsp-unauthed01.binero.net (HELO bin-vsp-out-01.atm.binero.net) (195.74.38.225) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 17 Feb 2015 07:45:32 +0000 X-Halon-ID: fba26d14-b678-11e4-acbf-005056917a89 Authorized-sender: jiri@gaisler.se Received: from vaio.orange-hotspot.com (unknown [81.253.22.86]) by bin-vsp-out-01.atm.binero.net (Halon Mail Gateway) with ESMTPSA; Tue, 17 Feb 2015 08:45:45 +0100 (CET) From: Jiri Gaisler To: gdb-patches@sourceware.org Cc: Jiri Gaisler Subject: [PATCH 09/23] sim/erc32: removed type mismatch compiler warnings Date: Tue, 17 Feb 2015 08:44:46 +0100 Message-Id: <1424159099-5148-10-git-send-email-jiri@gaisler.se> In-Reply-To: <1424159099-5148-1-git-send-email-jiri@gaisler.se> References: <1424159099-5148-1-git-send-email-jiri@gaisler.se> * func.c (batch, exec_cmd) save return value to avoid warnings. Also print simulation time as long long. --- sim/erc32/func.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sim/erc32/func.c b/sim/erc32/func.c index 1661175..a3da1c5 100644 --- a/sim/erc32/func.c +++ b/sim/erc32/func.c @@ -81,6 +81,7 @@ batch(sregs, fname) { FILE *fp; char lbuf[1024]; + char *tmp; if ((fp = fopen(fname, "r")) == NULL) { fprintf(stderr, "couldn't open batch file %s\n", fname); @@ -88,7 +89,7 @@ batch(sregs, fname) } while (!feof(fp)) { lbuf[0] = 0; - fgets(lbuf, 1023, fp); + tmp = fgets(lbuf, 1023, fp); if ((strlen(lbuf) > 0) && (lbuf[strlen(lbuf) - 1] == '\n')) lbuf[strlen(lbuf) - 1] = 0; printf("sis> %s\n", lbuf); @@ -382,7 +383,7 @@ exec_cmd(sregs, cmd) { char *cmd1, *cmd2; int32 stat; - uint32 len, i, clen, j; + uint32 len, i, clen, j, tmp; static uint32 daddr = 0; char *cmdsave; @@ -553,7 +554,7 @@ exec_cmd(sregs, cmd) sim_halt(); } else if (strncmp(cmd1, "shell", clen) == 0) { if ((cmd1 = strtok(NULL, " \t\n\r")) != NULL) { - system(&cmdsave[clen]); + tmp = system(&cmdsave[clen]); } } else if (strncmp(cmd1, "step", clen) == 0) { stat = run_sim(sregs, 1, 1); @@ -641,8 +642,8 @@ show_stat(sregs) sregs->nbranch; #endif - printf("\n Cycles : %9d\n\r", ebase.simtime - sregs->simstart); - printf(" Instructions : %9d\n", sregs->ninst); + printf("\n Cycles : %9llu\n\r", ebase.simtime - sregs->simstart); + printf(" Instructions : %9llu\n", sregs->ninst); #ifdef STAT printf(" integer : %9.2f %%\n", 100.0 * (float) iinst / (float) sregs->ninst);