From cadd68ea0014761eda6a293664086dfa80686d85 Mon Sep 17 00:00:00 2001 From: John Levon Date: Mon, 17 Dec 2018 21:29:17 +0000 Subject: 10078 smatch fixes for UCB Reviewed by: Andy Fiddaman Reviewed by: Toomas Soome Reviewed by: Peter Tribble Approved by: Robert Mustacchi --- usr/src/ucbcmd/Makefile.ucbcmd | 4 ++++ usr/src/ucblib/libcurses/Makefile.com | 4 ++++ usr/src/ucblib/libdbm/dbm.c | 16 ++++++++++------ usr/src/ucblib/librpcsoc/Makefile.com | 4 ++++ usr/src/ucblib/libtermcap/Makefile.com | 4 ++++ usr/src/ucblib/libucb/Makefile.com | 4 ++++ 6 files changed, 30 insertions(+), 6 deletions(-) (limited to 'usr/src') diff --git a/usr/src/ucbcmd/Makefile.ucbcmd b/usr/src/ucbcmd/Makefile.ucbcmd index e9156f269d..5eb4ee73e7 100644 --- a/usr/src/ucbcmd/Makefile.ucbcmd +++ b/usr/src/ucbcmd/Makefile.ucbcmd @@ -23,6 +23,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # +# Copyright (c) 2018, Joyent, Inc. # # ucbcmd/Makefile.ucbcmd # @@ -58,6 +59,9 @@ ROOTPROG32= $(PROG:%=$(ROOTBIN32)/%) ISAEXEC= $(ROOT)/usr/lib/isaexec +# don't lint any of ucbcmd +SMATCH=off + # storing LDLIBS in two macros allows reordering of options LDLIBS.cmd = $(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3) LDLIBS = $(LDLIBS.cmd) diff --git a/usr/src/ucblib/libcurses/Makefile.com b/usr/src/ucblib/libcurses/Makefile.com index 4c1d763415..3e018e1cfa 100644 --- a/usr/src/ucblib/libcurses/Makefile.com +++ b/usr/src/ucblib/libcurses/Makefile.com @@ -22,6 +22,7 @@ # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # +# Copyright (c) 2018, Joyent, Inc. LIBRARY= libcurses.a VERS= .1 @@ -89,6 +90,9 @@ CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-uninitialized +# not linted +SMATCH=off + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/ucblib/libdbm/dbm.c b/usr/src/ucblib/libdbm/dbm.c index f006db5ea9..e9afce9d15 100644 --- a/usr/src/ucblib/libdbm/dbm.c +++ b/usr/src/ucblib/libdbm/dbm.c @@ -31,6 +31,10 @@ * under license from the Regents of the University of California. */ +/* + * Copyright (c) 2018, Joyent, Inc. + */ + /*LINTLIBRARY*/ #include @@ -524,12 +528,12 @@ delitem(char buf[PBLKSIZ], int n) i2 = sp[n+1-1]; i3 = sp[sp[0]+1-1]; if (i2 > i1) - while (i1 > i3) { - i1--; - i2--; - buf[i2] = buf[i1]; - buf[i1] = 0; - } + while (i1 > i3) { + i1--; + i2--; + buf[i2] = buf[i1]; + buf[i1] = 0; + } i2 -= i1; for (i1 = n+1; i1 < sp[0]; i1++) sp[i1+1-1] = sp[i1+1] + i2; diff --git a/usr/src/ucblib/librpcsoc/Makefile.com b/usr/src/ucblib/librpcsoc/Makefile.com index 5807512ec3..a99827f813 100644 --- a/usr/src/ucblib/librpcsoc/Makefile.com +++ b/usr/src/ucblib/librpcsoc/Makefile.com @@ -22,6 +22,7 @@ # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # +# Copyright (c) 2018, Joyent, Inc. LIBRARY= librpcsoc.a VERS = .1 @@ -51,6 +52,9 @@ CPPFLAGS = -I$(SRC)/ucbhead -I../../../lib/libc/inc $(CPPFLAGS.master) CERRWARN += -_gcc=-Wno-uninitialized +# not linted +SMATCH=off + .KEEP_STATE: lint: lintcheck diff --git a/usr/src/ucblib/libtermcap/Makefile.com b/usr/src/ucblib/libtermcap/Makefile.com index 2bc6e3ca2e..b569240946 100644 --- a/usr/src/ucblib/libtermcap/Makefile.com +++ b/usr/src/ucblib/libtermcap/Makefile.com @@ -22,6 +22,7 @@ # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # +# Copyright (c) 2018, Joyent, Inc. LIBRARY= libtermcap.a VERS= .1 @@ -45,6 +46,9 @@ LDLIBS += -lc DEFS= -DCM_N -DCM_GT -DCM_B -DCM_D CPPFLAGS = $(DEFS) -I$(SRC)/ucbhead $(CPPFLAGS.master) +# not linted +SMATCH=off + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/ucblib/libucb/Makefile.com b/usr/src/ucblib/libucb/Makefile.com index 70b5ff2703..bb277af674 100644 --- a/usr/src/ucblib/libucb/Makefile.com +++ b/usr/src/ucblib/libucb/Makefile.com @@ -21,6 +21,7 @@ # # Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. # +# Copyright (c) 2018, Joyent, Inc. LIBRARY= libucb.a VERS= .1 @@ -98,6 +99,9 @@ CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-char-subscripts CERRWARN += -_gcc=-Wno-uninitialized +# not linted +SMATCH=off + ASFLAGS= -P -D__STDC__ -DLOCORE -D_SYS_SYS_S -D_ASM $(CPPFLAGS) pics/%.o:= ASFLAGS += $(AS_PICFLAGS) -- cgit v1.2.3