Check-in [af7f96faac]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Run through cppcheck
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:af7f96faac5a15d850c30634e7081a697139c158
User & Date: darrenbane 2014-10-15 18:54:13
Context
2014-10-21
21:40
Eliminate warnings with -Wall; need to eliminate externs and fn decls from C files check-in: 843d2adf7c user: darrenbane tags: trunk
2014-10-15
18:54
Run through cppcheck check-in: af7f96faac user: darrenbane tags: trunk
2014-05-09
22:02
Switch to Doxygen OO-in-C convention check-in: 1620d60a3d user: darrenbane tags: trunk
Changes

Changes to src/build.c.

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
..
65
66
67
68
69
70
71


72
73
74
75
76
77
78
79
..
88
89
90
91
92
93
94


95
96
97
98
99
100
101
102
void
addlbl(lbltype, lbllevel, lblname)
	char *lbltype;
	char *lbllevel;
	char *lblname;
{
	Type *tp = findtype(lbltype, 1);
	Label *lp;
	Label *last, *last_next;
	us int bottom;
	us int indx;

	if (!isdigit(lbllevel[0])) {
		warnx("%snon-numeric index level", maybe_loc());
		return;
	}
................................................................................
	bottom--;

	++(tp->t_levels[bottom]);
	for (indx = bottom + 1; indx < NLEVELS; indx++)
		tp->t_levels[indx] = 0;

	if (strcmp(lblname, "*") != 0) {


		lp = typeFindlabel(tp, lblname);

		if (lp != NULL) {
			warnx("%sredefinition of %s ignored", maybe_loc(), lblname);
			return;
		}
		lp = (Label *) alloc(sizeof(Label));
	   
................................................................................
		/*
		 * Add to end of list, so that verbose listing comes out in
		 * order
		 */
		if (LIST_EMPTY(&(tp->labelhead)))
	                LIST_INSERT_HEAD(&(tp->labelhead), lp, link);
		else {


		        last = LIST_FIRST(&(tp->labelhead));
			last_next = LIST_NEXT(last, link);
		        while (last_next != NULL) {
			        last = last_next;
			        last_next = LIST_NEXT(last, link);
			}
		        LIST_INSERT_AFTER(last, lp, link);
		}







|
<







 







>
>
|







 







>
>
|







45
46
47
48
49
50
51
52

53
54
55
56
57
58
59
..
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
..
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
void
addlbl(lbltype, lbllevel, lblname)
	char *lbltype;
	char *lbllevel;
	char *lblname;
{
	Type *tp = findtype(lbltype, 1);
	Label *last_next;

	us int bottom;
	us int indx;

	if (!isdigit(lbllevel[0])) {
		warnx("%snon-numeric index level", maybe_loc());
		return;
	}
................................................................................
	bottom--;

	++(tp->t_levels[bottom]);
	for (indx = bottom + 1; indx < NLEVELS; indx++)
		tp->t_levels[indx] = 0;

	if (strcmp(lblname, "*") != 0) {
                Label *lp;

                lp = typeFindlabel(tp, lblname);

		if (lp != NULL) {
			warnx("%sredefinition of %s ignored", maybe_loc(), lblname);
			return;
		}
		lp = (Label *) alloc(sizeof(Label));
	   
................................................................................
		/*
		 * Add to end of list, so that verbose listing comes out in
		 * order
		 */
		if (LIST_EMPTY(&(tp->labelhead)))
	                LIST_INSERT_HEAD(&(tp->labelhead), lp, link);
		else {
                        Label *last;

                        last = LIST_FIRST(&(tp->labelhead));
			last_next = LIST_NEXT(last, link);
		        while (last_next != NULL) {
			        last = last_next;
			        last_next = LIST_NEXT(last, link);
			}
		        LIST_INSERT_AFTER(last, lp, link);
		}

Changes to src/lbl.c.

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
..
82
83
84
85
86
87
88


89
90
91
92
93
94
95
int
main(argc, argv)
	int argc;
	char *argv[];
{
	us int decode();
	us int nflags;
	FILE *input;
	int anydone = 0;
	static char standard[] = "standard input";

	if (argc != 0) {
		argc--;
		progname = *(argv++);
	}
................................................................................
		anydone = 1;
	} else {
		while (argc != 0) {
			if (strcmp(argv[0], "-") == 0) {
				anydone = 1;
				scan(standard, stdin);
			} else {


				if ((input = fopen(argv[0], "r")) == NULL)
					warnx("%scannot open %s", maybe_loc(), argv[0]);
				else {
					anydone = 1;
					scan(argv[0], input);
					fclose(input);
				}







<







 







>
>







49
50
51
52
53
54
55

56
57
58
59
60
61
62
..
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
int
main(argc, argv)
	int argc;
	char *argv[];
{
	us int decode();
	us int nflags;

	int anydone = 0;
	static char standard[] = "standard input";

	if (argc != 0) {
		argc--;
		progname = *(argv++);
	}
................................................................................
		anydone = 1;
	} else {
		while (argc != 0) {
			if (strcmp(argv[0], "-") == 0) {
				anydone = 1;
				scan(standard, stdin);
			} else {
                                FILE *input;
                                
				if ((input = fopen(argv[0], "r")) == NULL)
					warnx("%scannot open %s", maybe_loc(), argv[0]);
				else {
					anydone = 1;
					scan(argv[0], input);
					fclose(input);
				}

Changes to src/printl.c.

65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
		continue;
	}
}

/* Print Decimal */
void
printd(n, out)
	us int n;
	FILE *out;
{
	fprintf(out, "%u", n);
}

/* Print Alphabetic
 *	actually base 26 (digits a-z), displaced by 1!







|







65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
		continue;
	}
}

/* Print Decimal */
void
printd(n, out)
	unsigned int n;
	FILE *out;
{
	fprintf(out, "%u", n);
}

/* Print Alphabetic
 *	actually base 26 (digits a-z), displaced by 1!

Changes to src/signals.c.

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
	unlink(tempname);
	_exit(2);
}

void
setsignals()
{
	sig_t oldsig;

	if ((oldsig = signal(SIGINT, onsignal)) == SIG_IGN)
		signal(SIGINT, SIG_IGN);
	if ((oldsig = signal(SIGQUIT, onsignal)) == SIG_IGN)
		signal(SIGQUIT, SIG_IGN);
	if ((oldsig = signal(SIGHUP, onsignal)) == SIG_IGN)
		signal(SIGHUP, SIG_IGN);
	if ((oldsig = signal(SIGTERM, onsignal)) == SIG_IGN)
		signal(SIGTERM, SIG_IGN);
}







<
<
|

|

|

|


22
23
24
25
26
27
28


29
30
31
32
33
34
35
36
37
	unlink(tempname);
	_exit(2);
}

void
setsignals()
{


	if (signal(SIGINT, onsignal) == SIG_IGN)
		signal(SIGINT, SIG_IGN);
	if (signal(SIGQUIT, onsignal) == SIG_IGN)
		signal(SIGQUIT, SIG_IGN);
	if (signal(SIGHUP, onsignal) == SIG_IGN)
		signal(SIGHUP, SIG_IGN);
	if (signal(SIGTERM, onsignal) == SIG_IGN)
		signal(SIGTERM, SIG_IGN);
}