Ticket #13913: 0002-bin-pc-Mark-non-returning-function-as-void.patch

File 0002-bin-pc-Mark-non-returning-function-as-void.patch, 1.3 KB (added by tuankiet65, 6 years ago)
  • src/bin/pc/pc.c

    From 8a3884a4e1b278e68ce578f281862801e1d23c67 Mon Sep 17 00:00:00 2001
    From: Ho Tuan Kiet <tuankiet65@gmail.com>
    Date: Fri, 29 Dec 2017 22:47:27 +0700
    Subject: [PATCH 2/3] bin/pc: Mark non-returning function as void
    
    set_var doesn't return any value yet its return type is ULONG, and Coverity freaks out about that. This patch turns that function into a void function.
    
    Coverity CID: 603433
    ---
     src/bin/pc/pc.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/src/bin/pc/pc.c b/src/bin/pc/pc.c
    index efd90924a3..05fb9123f1 100644
    a b ULONG term(char **str); /* multiplication/division *,%,/ */  
    134134ULONG factor(char **str);            /* negation, logical not ~, ! */
    135135ULONG get_value(char **str);
    136136int   get_var(char *name, ULONG *val); /* external interfaces to vars */
    137 ULONG set_var(char *name, ULONG val);
     137void set_var(char *name, ULONG val);
    138138
    139139void  do_input(void);                /* reads stdin and calls parser */
    140140char *skipwhite(char *str);          /* skip over input white space */
    add_var(char *name, ULONG value)  
    10181018   This routine and the companion get_var() are external
    10191019   interfaces to the variable manipulation routines.
    10201020*/   
    1021 ULONG
     1021void
    10221022set_var(char *name, ULONG val)
    10231023{
    10241024  variable *v;