From aef3a93e3abf906786925f1a2c323692f30b6d97 Mon Sep 17 00:00:00 2001 From: "toshok%hungry.com" Date: Thu, 10 Dec 1998 11:52:47 +0000 Subject: [PATCH] fix warnings by providing empty virtual destructors for classes that needed them, reordering initialization of member variables, and by giving the type uint to all the 'const nFooTypes;' variables. git-svn-id: svn://10.0.0.236/trunk@16148 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/ef/Compiler/CodeGenerator/Instruction.h | 4 ++++ mozilla/ef/Compiler/FrontEnd/TranslationEnv.h | 2 +- mozilla/ef/Compiler/PrimitiveGraph/ControlNodes.h | 2 +- mozilla/ef/Compiler/PrimitiveGraph/Primitives.h | 6 ++++-- mozilla/ef/Compiler/PrimitiveGraph/Value.h | 2 +- mozilla/ef/Debugger/Debugger.cpp | 4 ++-- mozilla/ef/Debugger/Debugger.h | 4 ++-- mozilla/ef/Runtime/System/JavaObject.h | 12 ++++++------ mozilla/ef/Tools/Nad/nad.pl | 2 +- mozilla/ef/Utilities/General/DebugUtils.h | 2 +- mozilla/ef/Utilities/General/InterestingEvents.h | 2 +- 11 files changed, 24 insertions(+), 18 deletions(-) diff --git a/mozilla/ef/Compiler/CodeGenerator/Instruction.h b/mozilla/ef/Compiler/CodeGenerator/Instruction.h index 9468c2aa4e4..507f76e60ab 100644 --- a/mozilla/ef/Compiler/CodeGenerator/Instruction.h +++ b/mozilla/ef/Compiler/CodeGenerator/Instruction.h @@ -246,6 +246,8 @@ public: InsnExternalUse(DataNode* inSrcPrimitive, Pool& inPool, Uint8 inUse) : InsnUseXDefineYFromPool(inSrcPrimitive, inPool, inUse, 0) {} + virtual ~InsnExternalUse() {} + virtual InstructionFlags getFlags() const { return (ifExternalInsn); } #ifdef DEBUG_LOG @@ -262,6 +264,8 @@ public: InsnExternalDefine(DataNode* inSrcPrimitive, Pool& inPool, Uint8 inDefine) : InsnUseXDefineYFromPool(inSrcPrimitive, inPool, 0, inDefine) {} + virtual ~InsnExternalDefine() {} + virtual InstructionFlags getFlags() const { return (ifExternalInsn); } #ifdef DEBUG_LOG diff --git a/mozilla/ef/Compiler/FrontEnd/TranslationEnv.h b/mozilla/ef/Compiler/FrontEnd/TranslationEnv.h index 6129f1025bc..43b3e32cf6a 100644 --- a/mozilla/ef/Compiler/FrontEnd/TranslationEnv.h +++ b/mozilla/ef/Compiler/FrontEnd/TranslationEnv.h @@ -397,7 +397,7 @@ inline void TranslationBinding::define(const VariableOrConstant &poc, ControlNod // ---------------------------------------------------------------------------- -const initialPhiSize = 3; +const Uint32 initialPhiSize = 3; // // Create a new translation binding environment. diff --git a/mozilla/ef/Compiler/PrimitiveGraph/ControlNodes.h b/mozilla/ef/Compiler/PrimitiveGraph/ControlNodes.h index f50e32ecc11..97a60cc35b2 100644 --- a/mozilla/ef/Compiler/PrimitiveGraph/ControlNodes.h +++ b/mozilla/ef/Compiler/PrimitiveGraph/ControlNodes.h @@ -63,7 +63,7 @@ enum ControlKind // NormalIncoming? NormalOutgoing? OneNormalOutgoing? ckCatch, // no yes yes no yes ckReturn // yes no no no no }; -const nControlKinds = ckReturn + 1; +const uint nControlKinds = ckReturn + 1; struct ControlKindProperties { diff --git a/mozilla/ef/Compiler/PrimitiveGraph/Primitives.h b/mozilla/ef/Compiler/PrimitiveGraph/Primitives.h index 30b983c97e4..287aae87746 100644 --- a/mozilla/ef/Compiler/PrimitiveGraph/Primitives.h +++ b/mozilla/ef/Compiler/PrimitiveGraph/Primitives.h @@ -44,7 +44,7 @@ enum PrimitiveFormat pfSysCall, // SysCall pfCall // Call }; -const nPrimitiveFormats = pfCall + 1; +const uint nPrimitiveFormats = pfCall + 1; enum PrimitiveCategory { @@ -78,7 +78,7 @@ enum PrimitiveCategory pcSysCall, // SysCall pcCall // Call }; -const nPrimitiveCategories = pcCall + 1; +const uint nPrimitiveCategories = pcCall + 1; extern const PrimitiveFormat categoryFormats[nPrimitiveCategories]; @@ -291,6 +291,8 @@ class DataNode public: DataNode(ValueKind kind) : kind(kind), constant(true) {}; + virtual ~DataNode() {}; + // Use these instead of expressions like "getFormat() == pfLd" because the latter doesn't do // type checking -- the compiler will happily let you make errors like "getFormat() == pcLd". inline bool isConstant() const {return constant;} diff --git a/mozilla/ef/Compiler/PrimitiveGraph/Value.h b/mozilla/ef/Compiler/PrimitiveGraph/Value.h index f840ec782bb..93477344491 100644 --- a/mozilla/ef/Compiler/PrimitiveGraph/Value.h +++ b/mozilla/ef/Compiler/PrimitiveGraph/Value.h @@ -105,7 +105,7 @@ enum ValueKind // Concrete? RegOrMem? #words (as defined by the Java stack vkMemory, // no no yes no N/A // Value representing all of memory in data flow edges vkTuple // no no no no N/A // Value representing a tuple of other values }; -const nValueKinds = vkTuple + 1; +const uint nValueKinds = vkTuple + 1; inline ValueKind typeKindToValueKind(TypeKind tk); diff --git a/mozilla/ef/Debugger/Debugger.cpp b/mozilla/ef/Debugger/Debugger.cpp index 2bdbdfa3e5e..cc47a2fde1c 100644 --- a/mozilla/ef/Debugger/Debugger.cpp +++ b/mozilla/ef/Debugger/Debugger.cpp @@ -29,9 +29,9 @@ UT_DEFINE_LOG_MODULE(Debugger); DebuggerState::DebuggerState(Pool& p) : - pool(p), + breakpoints(NULL), enabled(false), - breakpoints(NULL) + pool(p) { } diff --git a/mozilla/ef/Debugger/Debugger.h b/mozilla/ef/Debugger/Debugger.h index f1767bb22a5..25f676ae1df 100644 --- a/mozilla/ef/Debugger/Debugger.h +++ b/mozilla/ef/Debugger/Debugger.h @@ -95,8 +95,8 @@ public: protected: DebuggerServerChannel(PRFileDesc* inSync, PRFileDesc* inAsync) : EventListener(gCompileOrLoadBroadcaster), - mAsync(inAsync), - mSync(inSync) { } + mSync(inSync), + mAsync(inAsync) { } void handleRequest(Int32 inRequest); void handleMethodToAddress(); diff --git a/mozilla/ef/Runtime/System/JavaObject.h b/mozilla/ef/Runtime/System/JavaObject.h index 682bb7c754c..ac78118d517 100644 --- a/mozilla/ef/Runtime/System/JavaObject.h +++ b/mozilla/ef/Runtime/System/JavaObject.h @@ -42,8 +42,8 @@ enum TypeKind tkArray, // 4 no sometimes // Java arrays tkInterface // 4 no no // Java interfaces }; -const nPrimitiveTypeKinds = tkDouble + 1; -const nTypeKinds = tkInterface + 1; +const uint nPrimitiveTypeKinds = tkDouble + 1; +const uint nTypeKinds = tkInterface + 1; inline bool NS_EXTERN isPrimitiveKind(TypeKind tk) {return tk <= tkDouble;} inline bool NS_EXTERN isNonVoidPrimitiveKind(TypeKind tk) {return tk >= tkBoolean && tk <= tkDouble;} @@ -571,14 +571,14 @@ enum StandardClass { cString, // java.lang.String cInterruptedException // java.lang.InterruptedException }; -const nStandardClasses = cString + 1; -const firstOrdinaryStandardClass = cThrowable; +const uint nStandardClasses = cString + 1; +const uint firstOrdinaryStandardClass = cThrowable; // Standard interfaces enum StandardInterface { iCloneable // java.lang.Cloneable }; -const nStandardInterfaces = iCloneable + 1; +const uint nStandardInterfaces = iCloneable + 1; // Standard objects @@ -592,7 +592,7 @@ enum StandardObject { oNullPointerException, // new java.lang.NullPointerException() oInterruptedException // new java.lang.InterruptedException() }; -const nStandardObjects = oNullPointerException + 1; +const uint nStandardObjects = oNullPointerException + 1; class NS_EXTERN Standard diff --git a/mozilla/ef/Tools/Nad/nad.pl b/mozilla/ef/Tools/Nad/nad.pl index 1f112a28e85..d1f3281bedd 100644 --- a/mozilla/ef/Tools/Nad/nad.pl +++ b/mozilla/ef/Tools/Nad/nad.pl @@ -104,7 +104,7 @@ outputNodeTemplates($DataNodeTemplateFN, \@gPrimitiveInfo); unlink ($PrimitiveOperationsEnumFN) or break; $gLastPrimEnumName = outputEnumFromListX("PrimitiveOperation", $PrimitiveOperationsEnumFN, 0, \@gPrimitiveInfo, \&primInfoToEnumDescriptor); open FILE, ">>$PrimitiveOperationsEnumFN" or die "Couldn't open $PrimitiveOperationsEnumFN: $!\n"; -print FILE "\nconst nPrimitiveOperations = $gLastPrimEnumName + 1;\n"; +print FILE "\nconst uint nPrimitiveOperations = $gLastPrimEnumName + 1;\n"; close FILE; # now handle the BURG section of the file diff --git a/mozilla/ef/Utilities/General/DebugUtils.h b/mozilla/ef/Utilities/General/DebugUtils.h index 6b578e538ff..c5f7bf93ab6 100644 --- a/mozilla/ef/Utilities/General/DebugUtils.h +++ b/mozilla/ef/Utilities/General/DebugUtils.h @@ -24,7 +24,7 @@ #ifdef DEBUG_LOG -const tabWidth = 0; // Width of tabs in output stream; 0 means no tabs +const uint tabWidth = 0; // Width of tabs in output stream; 0 means no tabs void printSpaces(LogModuleObject &f, int nSpaces); void printMargin(LogModuleObject &f, int margin); diff --git a/mozilla/ef/Utilities/General/InterestingEvents.h b/mozilla/ef/Utilities/General/InterestingEvents.h index 188663be4a8..079dc445f8d 100644 --- a/mozilla/ef/Utilities/General/InterestingEvents.h +++ b/mozilla/ef/Utilities/General/InterestingEvents.h @@ -125,7 +125,7 @@ public: } - ~EventListener() { } + virtual ~EventListener() { } virtual void listenToMessage(BroadcastEventKind inKind, void* inArgument) = 0; };