changeset 20597:2e48d4e9b925

10078 smatch fixes for UCB Reviewed by: Andy Fiddaman <omnios@citrus-it.net> Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Peter Tribble <peter.tribble@gmail.com> Approved by: Robert Mustacchi <rm@joyent.com>
author John Levon <john.levon@joyent.com>
date Mon, 17 Dec 2018 21:29:17 +0000
parents 068da7e6bca0
children 973230bc8d42
files usr/src/ucbcmd/Makefile.ucbcmd usr/src/ucblib/libcurses/Makefile.com usr/src/ucblib/libdbm/dbm.c usr/src/ucblib/librpcsoc/Makefile.com usr/src/ucblib/libtermcap/Makefile.com usr/src/ucblib/libucb/Makefile.com
diffstat 6 files changed, 30 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/ucbcmd/Makefile.ucbcmd	Wed Jan 09 14:01:58 2019 +0000
+++ b/usr/src/ucbcmd/Makefile.ucbcmd	Mon Dec 17 21:29:17 2018 +0000
@@ -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 @@
 
 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)
--- a/usr/src/ucblib/libcurses/Makefile.com	Wed Jan 09 14:01:58 2019 +0000
+++ b/usr/src/ucblib/libcurses/Makefile.com	Mon Dec 17 21:29:17 2018 +0000
@@ -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-unused-variable
 CERRWARN +=	-_gcc=-Wno-uninitialized
 
+# not linted
+SMATCH=off
+
 .KEEP_STATE:
 
 all: $(LIBS)
--- a/usr/src/ucblib/libdbm/dbm.c	Wed Jan 09 14:01:58 2019 +0000
+++ b/usr/src/ucblib/libdbm/dbm.c	Mon Dec 17 21:29:17 2018 +0000
@@ -31,6 +31,10 @@
  * under license from the Regents of the University of California.
  */
 
+/*
+ * Copyright (c) 2018, Joyent, Inc.
+ */
+
 /*LINTLIBRARY*/
 
 #include	<sys/types.h>
@@ -524,12 +528,12 @@
 		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;
--- a/usr/src/ucblib/librpcsoc/Makefile.com	Wed Jan 09 14:01:58 2019 +0000
+++ b/usr/src/ucblib/librpcsoc/Makefile.com	Mon Dec 17 21:29:17 2018 +0000
@@ -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 @@
 
 CERRWARN += -_gcc=-Wno-uninitialized
 
+# not linted
+SMATCH=off
+
 .KEEP_STATE:
 
 lint: lintcheck
--- a/usr/src/ucblib/libtermcap/Makefile.com	Wed Jan 09 14:01:58 2019 +0000
+++ b/usr/src/ucblib/libtermcap/Makefile.com	Mon Dec 17 21:29:17 2018 +0000
@@ -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 @@
 DEFS= -DCM_N -DCM_GT -DCM_B -DCM_D
 CPPFLAGS = $(DEFS) -I$(SRC)/ucbhead $(CPPFLAGS.master)
 
+# not linted
+SMATCH=off
+
 .KEEP_STATE:
 
 all: $(LIBS)
--- a/usr/src/ucblib/libucb/Makefile.com	Wed Jan 09 14:01:58 2019 +0000
+++ b/usr/src/ucblib/libucb/Makefile.com	Mon Dec 17 21:29:17 2018 +0000
@@ -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-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)