Revision 582
Modernised generated database handling code, marking the confusing parameterless Get functions with bool return type as obsolete.
Modified: ctp2_code\gs\dbgen\Datum.cpp
Modified: ctp2_code\gs\dbgen\Datum.h
Modified: ctp2_code\gs\dbgen\MemberClass.cpp
Modified: ctp2_code\gs\dbgen\MemberClass.h
Modified: ctp2_code\gs\dbgen\RecordDescription.cpp
Modified: ctp2_code\gs\dbgen\RecordDescription.h
Modified: ctp2_code\gs\dbgen\ctpdb.cpp
Modified: ctp2_code\gs\events\GameEventHook.cpp
Modified: ctp2_code\gs\events\GameEventHook.h
Modified: ctp2_code\gs\events\GameEventManager.cpp
Modified: ctp2_code\gs\events\GameEventManager.h
Modified: ctp2_code\gs\newdb\CTPDatabase.cpp
Modified: ctp2_code\gs\newdb\CTPDatabase.h
Modified: ctp2_code\gs\newdb\CTPRecord.h
In the current code, there are 2 versions of the generated Get<Property> functions - both returning a bool that merely indicates the presence of a property. You have to use the version with the parameter to access the value of the property.
Unfortunately, there are a lot of occurences where the bool (presence) return of the parameterless version of the Get function is used as if it were the actual value of the property. Because a bool can be converted to most other types (as 0 or 1), you do not get a warning for this.
To be able to detect these occurrences, I have renamed the parameterless version to Has<Property>. Using the old function name is still possible (for now), but will generate a warning when compiling with MSVS 2005.
Modernised generated database handling code, marking the confusing parameterless Get functions with bool return type as obsolete.
Modified: ctp2_code\gs\dbgen\Datum.cpp
Modified: ctp2_code\gs\dbgen\Datum.h
Modified: ctp2_code\gs\dbgen\MemberClass.cpp
Modified: ctp2_code\gs\dbgen\MemberClass.h
Modified: ctp2_code\gs\dbgen\RecordDescription.cpp
Modified: ctp2_code\gs\dbgen\RecordDescription.h
Modified: ctp2_code\gs\dbgen\ctpdb.cpp
Modified: ctp2_code\gs\events\GameEventHook.cpp
Modified: ctp2_code\gs\events\GameEventHook.h
Modified: ctp2_code\gs\events\GameEventManager.cpp
Modified: ctp2_code\gs\events\GameEventManager.h
Modified: ctp2_code\gs\newdb\CTPDatabase.cpp
Modified: ctp2_code\gs\newdb\CTPDatabase.h
Modified: ctp2_code\gs\newdb\CTPRecord.h
In the current code, there are 2 versions of the generated Get<Property> functions - both returning a bool that merely indicates the presence of a property. You have to use the version with the parameter to access the value of the property.
Unfortunately, there are a lot of occurences where the bool (presence) return of the parameterless version of the Get function is used as if it were the actual value of the property. Because a bool can be converted to most other types (as 0 or 1), you do not get a warning for this.
To be able to detect these occurrences, I have renamed the parameterless version to Has<Property>. Using the old function name is still possible (for now), but will generate a warning when compiling with MSVS 2005.
Comment