< # define numERCS (lastERC - firstERC + 1) --- > # define numERCS (/*@+enumint@*/ (lastERC - firstERC + 1) /*@=enumint@*/)
< erc db[numERCS]; --- > typedef /*@only@*/ erc o_erc; > static o_erc db[numERCS];
< bool initDone = FALSE; --- > /*@iter employeeKinds_all (yield employeeKinds ek); @*/ > # define employeeKinds_all(m_ek) \ > { employeeKinds m_ek; for (m_ek = firstERC; m_ek <= lastERC; m_ek++) {
> # define end_employeeKinds_all }} > > static bool initDone = FALSE; >
> /*@globals initDone, undef db@*/ > /*@modifies initDone, db@*/
< int i; <
< for (i = firstERC; i <= lastERC; i++) --- > employeeKinds_all (ek)
< db[i] = erc_create (); < } --- > db[(int)ek] = erc_create (); > } end_employeeKinds_all ;
< eref _db_ercKeyGet (erc c, int key) --- > static eref db_ercKeyGet(erc c, int key)
< eref _db_keyGet (int key) --- > static eref db_keyGet (int key)
< int i;
< for (i = firstERC; i <= lastERC; i++) --- > employeeKinds_all (ek)
< er = _db_ercKeyGet (db[i], key); --- > er = db_ercKeyGet (db[(int) ek], key);
< } --- > } end_employeeKinds_all ;
< int _db_addEmpls (erc c, int l, int h, empset s) --- > static int db_addEmpls (erc c, int l, int h, empset s) > /*@modifies s@*/
< if (!eref_equal (_db_keyGet (e.ssNum), erefNIL)) --- > if (!eref_equal (db_keyGet (e.ssNum), erefNIL))
> /*@globals db@*/
< erc_insert (db[mMGRS], er); --- > erc_insert (db[(int) mMGRS], er);
< erc_insert (db[mNON], er); --- > erc_insert (db[(int) mNON], er);
< erc_insert (db[fMGRS], er); --- > erc_insert (db[(int) fMGRS], er);
< erc_insert (db[fNON], er); --- > erc_insert (db[(int) fNON], er);
> /*@globals db@*/
< int i; < < for (i = firstERC; i <= lastERC; i++) --- > employeeKinds_all (ek)
< erc_elements(db[i], er) --- > erc_elements (db[(int) ek], er)
< erc_delete(db[i], er); --- > erc_delete (db[(int) ek], er);
< } --- > } end_employeeKinds_all ;
> /*@globals db@*/
< er = _db_ercKeyGet (db[mNON], ssNum); --- > er = db_ercKeyGet (db[(int) mNON], ssNum);
< er = _db_ercKeyGet (db[fNON], ssNum); --- > er = db_ercKeyGet (db[(int) fNON], ssNum);
< erc_delete (db[mNON], er); < erc_insert (db[mMGRS], er); --- > erc_delete (db[(int) mNON], er); > erc_insert (db[(int) mMGRS], er);
< erc_delete (db[fNON], er); < erc_insert (db[fMGRS], er); --- > erc_delete (db[(int) fNON], er); > erc_insert (db[(int) fMGRS], er);
< er = _db_keyGet (ssNum); --- > er = db_keyGet (ssNum);
> /*@globals db@*/
< int i;
< for (i = firstERC; i <= lastERC; i++) < numAdded += _db_addEmpls (db[i], l, h, s); --- > > employeeKinds_all (ek) > { > numAdded += db_addEmpls (db[(int) ek], l, h, s); > } end_employeeKinds_all >
< numAdded = _db_addEmpls (db[mMGRS], l, h, s); < numAdded += _db_addEmpls (db[fMGRS], l, h, s); --- > numAdded = db_addEmpls (db[(int) mMGRS], l, h, s); > numAdded += db_addEmpls (db[(int) fMGRS], l, h, s);
< numAdded = _db_addEmpls (db[mNON], l, h, s); < numAdded += _db_addEmpls (db[fNON], l, h, s); --- > numAdded = db_addEmpls (db[(int) mNON], l, h, s); > numAdded += db_addEmpls (db[(int) fNON], l, h, s);
< numAdded = _db_addEmpls (db[mMGRS], l, h, s); < numAdded += _db_addEmpls (db[mNON], l, h, s); --- > numAdded = db_addEmpls (db[(int) mMGRS], l, h, s); > numAdded += db_addEmpls (db[(int) mNON], l, h, s);
< return _db_addEmpls (db[mMGRS], l, h, s); --- > return db_addEmpls (db[(int) mMGRS], l, h, s);
< return _db_addEmpls (db[mNON], l, h, s); --- > return db_addEmpls (db[(int) mNON], l, h, s);
< numAdded = _db_addEmpls (db[fMGRS], l, h, s); < numAdded += _db_addEmpls (db[fNON], l, h, s); --- > numAdded = db_addEmpls (db[(int) fMGRS], l, h, s); > numAdded += db_addEmpls (db[(int) fNON], l, h, s);
< return _db_addEmpls (db[fMGRS], l, h, s); --- > return db_addEmpls (db[(int) fMGRS], l, h, s);
< return _db_addEmpls (db[fNON], l, h, s); --- > return db_addEmpls (db[(int) fNON], l, h, s);
> /*@globals db@*/
< int i;
< for (i = firstERC; i <= lastERC; i++) --- > employeeKinds_all (ek)
< printVal = erc_sprint (db[i]); --- > printVal = erc_sprint (db[(int) ek]);
< } --- > } end_employeeKinds_all ;
< int i, j; --- > int i; > db_status status;
< uncheckedHire(e); j = hire(e); --- > uncheckedHire(e); status = hire(e);
< printf("Should print 4: %d\n", /*@-usedef@*/ j /*@=usedef@*/); --- > printf("Should print true: %s\n", > bool_unparse (/*@-usedef@*/ status == duplERR /*@=usedef@*/)); >
> typedef /*@observer@*/ char *obscharp; >
< static char *gender[] ={ "male", "female", "?" }; < static char *jobs[] = { "manager", "non-manager", "?" }; --- > static obscharp gender[] ={ "male", "female", "?" }; > static obscharp jobs[] = { "manager", "non-manager", "?" };
< gender[e.gen], jobs[e.j], e.salary); --- > gender[(int) e.gen], jobs[(int) e.j], e.salary);
< eref _empset_get (employee e, erc s) --- > static eref empset_get (employee e, erc s)
> bool empset_member (employee e, erc s) > { > return (!eref_equal(empset_get (e, s), erefNIL)); > } >
< if (!eref_equal (_empset_get (e, s), erefNIL)) --- > if (!eref_equal (empset_get (e, s), erefNIL))
> /*@globals known@*/
< er = _empset_get (e, s); --- > er = empset_get (e, s);
> /*@globals initDone, undef known@*/ > /*@modifies initDone, known@*/
< ereftab known; --- > /*@only@*/ ereftab known;
< # define empset_member(e, s) \ < (!(eref_equal(_empset_get(e, s), erefNIL)))
< size_t s = (size_t) x; < < if ((int) s != x) < { < fprintf (stderr, "Error: int_toSize is inconsistent: %d", x); < return 0; < } < < return s; --- > return (size_t) x;
> /*@globals eref_Pool@*/ > /*@modifies eref_Pool@*/
< /*@globals undef eref_Pool@*/ --- > /*@globals undef eref_Pool, needsInit@*/ > /*@modifies eref_Pool, needsInit@*/
> /*@globals eref_Pool@*/ > /*@modifies eref_Pool@*/
> /*@globals eref_Pool@*/ > /*@modifies eref_Pool@*/
> /*@globals eref_Pool@*/