]> andersk Git - splint.git/blame - test/db3/employee.c
Fixed manual typo.
[splint.git] / test / db3 / employee.c
CommitLineData
885824d3 1# include <stdio.h>
2# include <string.h>
3# include "employee.h"
4
5bool employee_setName (employee *e, char na [])
6{
7 size_t i;
8
9 for (i = 0; na[i] != '\0'; i++)
10 {
11 if (i == maxEmployeeName)
12 {
3120b462 13 e->name[0] = '\0';
885824d3 14 return FALSE;
15 }
16 }
17
18 strcpy (e->name, na);
19 return TRUE;
20}
21
22bool employee_equal (employee * e1, employee * e2)
23{
24 return ((e1->ssNum == e2->ssNum)
25 && (e1->salary == e2->salary)
26 && (e1->gen == e2->gen)
27 && (e1->j == e2->j)
28 && (strncmp (e1->name, e2->name, maxEmployeeName) == 0));
29}
30
31typedef /*@observer@*/ char *obscharp;
32
33void employee_sprint (char s[], employee e)
34{
35 static obscharp gender[] ={ "male", "female", "?" };
36 static obscharp jobs[] = { "manager", "non-manager", "?" };
37
38 (void) sprintf (s, FORMATEMPLOYEE, e.ssNum, e.name,
39 gender[(int) e.gen], jobs[(int) e.j], e.salary);
40}
41
This page took 1.065379 seconds and 5 git commands to generate.