diff --git a/src/BroList.h b/src/BroList.h index 0aa94d55ec..d4d3451a24 100644 --- a/src/BroList.h +++ b/src/BroList.h @@ -6,31 +6,24 @@ #include "List.h" class Expr; -declare(PList,Expr); -typedef PList(Expr) expr_list; +typedef PList expr_list; class ID; -declare(PList,ID); -typedef PList(ID) id_list; +typedef PList id_list; class Val; -declare(PList,Val); -typedef PList(Val) val_list; +typedef PList val_list; class Stmt; -declare(PList,Stmt); -typedef PList(Stmt) stmt_list; +typedef PList stmt_list; class BroType; -declare(PList,BroType); -typedef PList(BroType) type_list; +typedef PList type_list; class Attr; -declare(PList,Attr); -typedef PList(Attr) attr_list; +typedef PList attr_list; class Timer; -declare(PList,Timer); -typedef PList(Timer) timer_list; +typedef PList timer_list; #endif diff --git a/src/CCL.h b/src/CCL.h index 2870acf53a..867c56ca98 100644 --- a/src/CCL.h +++ b/src/CCL.h @@ -5,8 +5,7 @@ #include "List.h" -declare(List,ptr_compat_int); -typedef List(ptr_compat_int) int_list; +typedef List int_list; class CCL { public: diff --git a/src/Continuation.h b/src/Continuation.h index 009d2a87f3..373e049f98 100644 --- a/src/Continuation.h +++ b/src/Continuation.h @@ -50,8 +50,7 @@ private: int current_level; int suspend_level; - declare(PList, void); - typedef PList(void) voidp_list; + typedef PList voidp_list; voidp_list states; }; diff --git a/src/DNS_Mgr.h b/src/DNS_Mgr.h index 39f728c812..7ef84eb848 100644 --- a/src/DNS_Mgr.h +++ b/src/DNS_Mgr.h @@ -23,8 +23,7 @@ class EventHandler; class RecordType; class DNS_Mgr_Request; -declare(PList,DNS_Mgr_Request); -typedef PList(DNS_Mgr_Request) DNS_mgr_request_list; +typedef PList DNS_mgr_request_list; struct nb_dns_info; struct nb_dns_result; diff --git a/src/Dict.cc b/src/Dict.cc index 02886c6d5d..a179bbea77 100644 --- a/src/Dict.cc +++ b/src/Dict.cc @@ -50,9 +50,9 @@ public: } int bucket, offset; - PList(DictEntry)** ttbl; + PList** ttbl; const int* num_buckets_p; - PList(DictEntry) inserted; // inserted while iterating + PList inserted; // inserted while iterating }; Dictionary::Dictionary(dict_order ordering, int initial_size) @@ -61,7 +61,7 @@ Dictionary::Dictionary(dict_order ordering, int initial_size) tbl2 = 0; if ( ordering == ORDERED ) - order = new PList(DictEntry); + order = new PList; else order = 0; @@ -99,7 +99,7 @@ void Dictionary::DeInit() for ( int i = 0; i < num_buckets; ++i ) if ( tbl[i] ) { - PList(DictEntry)* chain = tbl[i]; + PList* chain = tbl[i]; loop_over_list(*chain, j) { DictEntry* e = (*chain)[j]; @@ -119,7 +119,7 @@ void Dictionary::DeInit() for ( int i = 0; i < num_buckets2; ++i ) if ( tbl2[i] ) { - PList(DictEntry)* chain = tbl2[i]; + PList* chain = tbl2[i]; loop_over_list(*chain, j) { DictEntry* e = (*chain)[j]; @@ -141,7 +141,7 @@ void* Dictionary::Lookup(const void* key, int key_size, hash_t hash) const return 0; hash_t h; - PList(DictEntry)* chain; + PList* chain; // Figure out which hash table to look in. h = hash % num_buckets; @@ -199,7 +199,7 @@ void* Dictionary::Remove(const void* key, int key_size, hash_t hash, return 0; hash_t h; - PList(DictEntry)* chain; + PList* chain; int* num_entries_ptr; // Figure out which hash table to look in @@ -240,7 +240,7 @@ void* Dictionary::Remove(const void* key, int key_size, hash_t hash, } void* Dictionary::DoRemove(DictEntry* entry, hash_t h, - PList(DictEntry)* chain, int chain_offset) + PList* chain, int chain_offset) { void* entry_value = entry->value; @@ -301,7 +301,7 @@ void* Dictionary::NextEntry(HashKey*& h, IterCookie*& cookie, int return_hash) c { if ( ! tbl && ! tbl2 ) { - const_cast(&cookies)->remove(cookie); + const_cast*>(&cookies)->remove(cookie); delete cookie; cookie = 0; return 0; @@ -326,7 +326,7 @@ void* Dictionary::NextEntry(HashKey*& h, IterCookie*& cookie, int return_hash) c int b = cookie->bucket; int o = cookie->offset; - PList(DictEntry)** ttbl; + PList** ttbl; const int* num_buckets_p; if ( ! cookie->ttbl ) @@ -368,7 +368,7 @@ void* Dictionary::NextEntry(HashKey*& h, IterCookie*& cookie, int return_hash) c // FIXME: I don't like removing the const here. But is there // a better way? - const_cast(&cookies)->remove(cookie); + const_cast*>(&cookies)->remove(cookie); delete cookie; cookie = 0; return 0; @@ -387,7 +387,7 @@ void* Dictionary::NextEntry(HashKey*& h, IterCookie*& cookie, int return_hash) c void Dictionary::Init(int size) { num_buckets = NextPrime(size); - tbl = new PList(DictEntry)*[num_buckets]; + tbl = new PList*[num_buckets]; for ( int i = 0; i < num_buckets; ++i ) tbl[i] = 0; @@ -399,7 +399,7 @@ void Dictionary::Init(int size) void Dictionary::Init2(int size) { num_buckets2 = NextPrime(size); - tbl2 = new PList(DictEntry)*[num_buckets2]; + tbl2 = new PList*[num_buckets2]; for ( int i = 0; i < num_buckets2; ++i ) tbl2[i] = 0; @@ -413,7 +413,7 @@ void* Dictionary::Insert(DictEntry* new_entry, int copy_key) if ( ! tbl ) Init(DEFAULT_DICT_SIZE); - PList(DictEntry)** ttbl; + PList** ttbl; int* num_entries_ptr; int* max_num_entries_ptr; hash_t h = new_entry->hash % num_buckets; @@ -438,7 +438,7 @@ void* Dictionary::Insert(DictEntry* new_entry, int copy_key) max_num_entries_ptr = &max_num_entries2; } - PList(DictEntry)* chain = ttbl[h]; + PList* chain = ttbl[h]; int n = new_entry->len; @@ -460,7 +460,7 @@ void* Dictionary::Insert(DictEntry* new_entry, int copy_key) } else // Create new chain. - chain = ttbl[h] = new PList(DictEntry); + chain = ttbl[h] = new PList; // If we got this far, then we couldn't use an existing copy // of the key, so make a new one if necessary. @@ -545,7 +545,7 @@ void Dictionary::MoveChains() do { - PList(DictEntry)* chain = tbl[tbl_next_ind++]; + PList* chain = tbl[tbl_next_ind++]; if ( ! chain ) continue; @@ -605,13 +605,13 @@ unsigned int Dictionary::MemoryAllocation() const for ( int i = 0; i < num_buckets; ++i ) if ( tbl[i] ) { - PList(DictEntry)* chain = tbl[i]; + PList* chain = tbl[i]; loop_over_list(*chain, j) size += padded_sizeof(DictEntry) + pad_size((*chain)[j]->len); size += chain->MemoryAllocation(); } - size += pad_size(num_buckets * sizeof(PList(DictEntry)*)); + size += pad_size(num_buckets * sizeof(PList*)); if ( order ) size += order->MemoryAllocation(); @@ -621,13 +621,13 @@ unsigned int Dictionary::MemoryAllocation() const for ( int i = 0; i < num_buckets2; ++i ) if ( tbl2[i] ) { - PList(DictEntry)* chain = tbl2[i]; + PList* chain = tbl2[i]; loop_over_list(*chain, j) size += padded_sizeof(DictEntry) + pad_size((*chain)[j]->len); size += chain->MemoryAllocation(); } - size += pad_size(num_buckets2 * sizeof(PList(DictEntry)*)); + size += pad_size(num_buckets2 * sizeof(PList*)); } return size; diff --git a/src/Dict.h b/src/Dict.h index 75eb34abe9..4e261e3658 100644 --- a/src/Dict.h +++ b/src/Dict.h @@ -10,9 +10,6 @@ class Dictionary; class DictEntry; class IterCookie; -declare(PList,DictEntry); -declare(PList,IterCookie); - // Type indicating whether the dictionary should keep track of the order // of insertions. typedef enum { ORDERED, UNORDERED } dict_order; @@ -132,7 +129,7 @@ private: void* Insert(DictEntry* entry, int copy_key); void* DoRemove(DictEntry* entry, hash_t h, - PList(DictEntry)* chain, int chain_offset); + PList* chain, int chain_offset); int NextPrime(int n) const; int IsPrime(int n) const; @@ -162,7 +159,7 @@ private: // When we're resizing, we'll have tbl (old) and tbl2 (new) // tbl_next_ind keeps track of how much we've moved to tbl2 // (it's the next index we're going to move). - PList(DictEntry)** tbl; + PList** tbl; int num_buckets; int num_entries; int max_num_entries; @@ -171,7 +168,7 @@ private: int thresh_entries; // Resizing table (replicates tbl above). - PList(DictEntry)** tbl2; + PList** tbl2; int num_buckets2; int num_entries2; int max_num_entries2; @@ -180,10 +177,10 @@ private: hash_t tbl_next_ind; - PList(DictEntry)* order; + PList* order; dict_delete_func delete_func; - PList(IterCookie) cookies; + PList cookies; }; diff --git a/src/EventRegistry.h b/src/EventRegistry.h index 8fba8d6762..d1bb650beb 100644 --- a/src/EventRegistry.h +++ b/src/EventRegistry.h @@ -22,8 +22,7 @@ public: // Returns a list of all local handlers that match the given pattern. // Passes ownership of list. typedef const char constchar; // PList doesn't like "const char" - declare(PList, constchar); - typedef PList(constchar) string_list; + typedef PList string_list; string_list* Match(RE_Matcher* pattern); // Marks a handler as handling errors. Error handler will not be called diff --git a/src/NFA.h b/src/NFA.h index 79c3961dd5..d1efc212ad 100644 --- a/src/NFA.h +++ b/src/NFA.h @@ -9,8 +9,7 @@ class NFA_State; class EquivClass; -declare(PList,NFA_State); -typedef PList(NFA_State) NFA_state_list; +typedef PList NFA_state_list; #define NO_ACCEPT 0 diff --git a/src/RE.h b/src/RE.h index 9386aa6f5f..8799bd8c36 100644 --- a/src/RE.h +++ b/src/RE.h @@ -24,7 +24,6 @@ class DFA_State; declare(PDict,char); declare(PDict,CCL); -declare(PList,CCL); extern int case_insensitive; extern CCL* curr_ccl; @@ -125,7 +124,7 @@ protected: PDict(char) defs; PDict(CCL) ccl_dict; - PList(CCL) ccl_list; + PList ccl_list; EquivClass equiv_class; int* ecs; DFA_Machine* dfa; diff --git a/src/Rule.h b/src/Rule.h index 8cfc3835dd..1d1416c933 100644 --- a/src/Rule.h +++ b/src/Rule.h @@ -14,8 +14,7 @@ class RuleHdrTest; class Rule; -declare(PList, Rule); -typedef PList(Rule) rule_list; +typedef PList rule_list; declare(PDict, Rule); typedef PDict(Rule) rule_dict; @@ -61,14 +60,9 @@ private: void SortHdrTests(); - declare(PList, RuleAction); - typedef PList(RuleAction) rule_action_list; - - declare(PList, RuleCondition); - typedef PList(RuleCondition) rule_condition_list; - - declare(PList, RuleHdrTest); - typedef PList(RuleHdrTest) rule_hdr_test_list; + typedef PList rule_action_list; + typedef PList rule_condition_list; + typedef PList rule_hdr_test_list; rule_hdr_test_list hdr_tests; rule_condition_list conditions; @@ -82,8 +76,7 @@ private: bool negate; // negate test }; - declare(PList, Precond); - typedef PList(Precond) precond_list; + typedef PList precond_list; precond_list preconds; rule_list dependents; // rules w/ us as a precondition @@ -101,8 +94,7 @@ private: uint32 depth; }; - declare(PList, Pattern); - typedef PList(Pattern) pattern_list; + typedef PList pattern_list; pattern_list patterns; Rule* next; // Linkage within RuleHdrTest tree: diff --git a/src/RuleMatcher.h b/src/RuleMatcher.h index 23b7e6d731..c02fe9aadd 100644 --- a/src/RuleMatcher.h +++ b/src/RuleMatcher.h @@ -56,13 +56,9 @@ struct MaskedValue { uint32 mask; }; -declare(PList, MaskedValue); -typedef PList(MaskedValue) maskedvalue_list; - -typedef PList(char) string_list; - -declare(PList, BroString); -typedef PList(BroString) bstr_list; +typedef PList maskedvalue_list; +typedef PList string_list; +typedef PList bstr_list; // Get values from Bro's script-level variables. extern void id_to_maskedvallist(const char* id, maskedvalue_list* append_to, @@ -119,8 +115,7 @@ private: int_list ids; // (only needed for debugging) }; - declare(PList, PatternSet); - typedef PList(PatternSet) pattern_set_list; + typedef PList pattern_set_list; pattern_set_list psets[Rule::TYPES]; // List of rules belonging to this node. @@ -136,8 +131,7 @@ private: int level; // level within the tree }; -declare(PList, RuleHdrTest); -typedef PList(RuleHdrTest) rule_hdr_test_list; +typedef PList rule_hdr_test_list; // RuleEndpointState keeps the per-stream matching state of one // connection endpoint. @@ -172,8 +166,7 @@ private: Rule::PatternType type; }; - declare(PList, Matcher); - typedef PList(Matcher) matcher_list; + typedef PList matcher_list; bool is_orig; analyzer::Analyzer* analyzer; @@ -212,8 +205,7 @@ private: RE_Match_State* state; }; - declare(PList, Matcher); - typedef PList(Matcher) matcher_list; + typedef PList matcher_list; matcher_list matchers; }; diff --git a/src/Scope.cc b/src/Scope.cc index 5107bd8e9a..fa0f467e71 100644 --- a/src/Scope.cc +++ b/src/Scope.cc @@ -7,8 +7,7 @@ #include "Scope.h" #include "Reporter.h" -declare(PList,Scope); -typedef PList(Scope) scope_list; +typedef PList scope_list; static scope_list scopes; static Scope* top_scope; diff --git a/src/Stmt.h b/src/Stmt.h index 7136ffe306..2042c008b5 100644 --- a/src/Stmt.h +++ b/src/Stmt.h @@ -195,8 +195,7 @@ protected: Stmt* s; }; -declare(PList,Case); -typedef PList(Case) case_list; +typedef PList case_list; class SwitchStmt : public ExprStmt { public: diff --git a/src/Type.h b/src/Type.h index 19fad4b2ce..17a74476ab 100644 --- a/src/Type.h +++ b/src/Type.h @@ -455,8 +455,7 @@ public: const char* id; }; -declare(PList,TypeDecl); -typedef PList(TypeDecl) type_decl_list; +typedef PList type_decl_list; class RecordType : public BroType { public: diff --git a/src/analyzer/protocol/mime/MIME.h b/src/analyzer/protocol/mime/MIME.h index 9fcf2ea468..fa85747626 100644 --- a/src/analyzer/protocol/mime/MIME.h +++ b/src/analyzer/protocol/mime/MIME.h @@ -84,7 +84,6 @@ protected: }; -// declare(PList, MIME_Header); typedef vector MIME_HeaderList; class MIME_Entity { diff --git a/src/scan.l b/src/scan.l index 9216f8d67a..be7008c499 100644 --- a/src/scan.l +++ b/src/scan.l @@ -126,8 +126,7 @@ public: // A stack of input buffers we're scanning. file_stack[len-1] is the // top of the stack. -declare(PList,FileInfo); -static PList(FileInfo) file_stack; +static PList file_stack; #define RET_CONST(v) \ { \ diff --git a/src/strings.bif b/src/strings.bif index f2661f8cc9..b0d30f60c1 100644 --- a/src/strings.bif +++ b/src/strings.bif @@ -360,7 +360,7 @@ Val* do_sub(StringVal* str_val, RE_Matcher* re, StringVal* repl, int do_all) // cut_points is a set of pairs of indices in str that should // be removed/replaced. A pair means "delete starting // at offset x, up to but not including offset y". - List(ptr_compat_int) cut_points; // where RE matches pieces of str + List cut_points; // where RE matches pieces of str int size = 0; // size of result