|
From: Miro J. <me...@me...> - 2003-08-23 16:59:52
|
Using a shell script (below), I found approximately all the macros
used in Whisper code. I would like to know what each one does so that
we can a. document the ones we need b. eliminate the ones we don't c.
rename ones we should and d. fix the ones that are wrong.
Without further ado, here's the full list of all identifiers
consisting of only _0-9A-Z and occurring on a line whose first
non-whitespace character is #, together with what I think should be
done to those macros. (The number preceding each is the number of
times it occurs on a #-line)
The ones holding me up right now are the debugging macros, because
they conflict with some other libraries I am trying to use, so I am
going to write up a separate proposal specifically for renaming
debugging macros and documenting the purpose of the ones that are not
clearly documented right now, and start cranking.
meeroh
// Other debugging stuff
1 DEBUGSTR_IF // Rename to WHISPER_
1 PACKET_MAX_DATA_LENGTH // Obsolete code, remove
2 CALL_INVARIANT // Rename to WHISPER_
2 CHECK_INVARIANT // Rename to WHISPER_
2 SAFE_ASSERT // Rename to WHISPER_
1 _CC // Rename
3 ASSERT_IF // Rename to WHISPER_
3 POSTCONDITION // Rename to WHISPER_
3 PRECONDITION // Rename to WHISPER_
1 TRACE // Rename to WHISPER_
1 TRACEFLOW // Rename to WHISPER_
8 ASSERTS_THROW // Rename to WHISPER_
2 COMPILE_CHECK // Rename to WHISPER_
3 OBSERVE // Rename to WHISPER_
2 REQUIRE // Rename to WHISPER_
3 VERIFY // Rename to WHISPER_
3 ENABLE_EXTRA_WARNINGS // Rename to WHISPER_, use in CW as well.
12 ASSERT // Rename to WHISPER_
27 _DEBUG // Eliminate
1 SAFE_DEBUGSTR // Rename to WHISPER_
1 __STL_DEBUG // OK
6 NDEBUG // Move from XDebug.h to XWhisperHeader.h
2 DEBUGSTR // Rename to WHISPER_
// Profiling
2 PROFILE_ASSERT // Rename to WHISPER_
4 PROFILE_THREADS // Rename to WHISPER_
// COM implementation
1 DEFINE_INTERFACE_FACTORY // Rename to WHISPER_
1 REGISTER_INTERFACE_FACTORY // Rename to WHISPER_
1 REGISTER_INTERFACE_NAME // Rename to WHISPER_
// CW specific
1 MSL_USE_PRECOMPILED_HEADERS // OK
2 __MSL_LONGLONG_SUPPORT__ // OK
1 _MSL_NO_LOCALE // Eliminate?
1 __MSL__ // Eliminate?
1 DEBUG_NEW // OK
1 DEBUG_NEW_BASIC // OK
// Mac specific
1 NATIVE_FLOATING_WINDOWS // Looks wrong
4 __D0 // Obsolete
1 USE_OLD_INPUT_SPROCKET_LABELS // Obsolete
1 USE_OLD_ISPNEED_STRUCT // Obsolete
4 INCLUDE_PREF_SPECIALIZATIONS // Rename to WHISPER_
// Windows specific
1 NOIME
1 NOMCX
1 WIN32_LEAN_AND_MEAN
1 NOMINMAX
1 NOSERVICE
1 REPLACEFILE_IGNORE_MERGE_ERRORS
1 REPLACEFILE_WRITE_THROUGH
10 _WIN32_DCOM
17 _WIN32_WINNT
2 UNICODE
1 STRICT
4 _MSC_VER // OK
// target macros
7 MSVC // Eliminate
1 __MRC__ // Eliminate
3 WINVER // Replace with a WHISPER_ macro?
1 __APPLE__ // OK
2 __MWERKS__ // OK
2 __MERKS__ // Bogus, fix
47 __INTEL__ // Eliminate
51 __POWERPC__ // Eliminate
17 __MC68K__ // Eliminate
1 TARGET_CPU_68K // Eliminate
1 TARGET_CPU_ALPHA // Eliminate
1 TARGET_CPU_MIPS // Eliminate
1 TARGET_CPU_SPARC // Eliminate
1 TARGET_CPU_X86 // Rename to WHISPER_
1 TARGET_OS_UNIX // Eliminate
2 TARGET_RT_MAC_MACHO // Rename to WHISPER_
3 TARGET_RT_MAC_CFM // Rename to WHISPER_
4 TARGET_RT_BIG_ENDIAN // Rename to WHISPER_
5 TARGET_CPU_PPC // Rename to WHISPER_
7 TARGET_RT_LITTLE_ENDIAN // Rename to WHISPER_
32 TARGET_CC_METROWERKS // Rename to WHISPER_
32 TARGET_CC_MICROSOFT // Rename to WHISPER_
90 TARGET_API_MAC_CARBON // Rename to WHISPER_
455 TARGET_OS_WIN32 // Rename to WHISPER_
707 TARGET_OS_MAC // Rename to WHISPER_
1 __MACH__ // OK
1 WIN // Eliminate
// Whisper target macros
4 PRECOMPILE_SYSTEM_HEADERS // Rename to WHISPER_
16 PRECOMPILE_STD_HEADERS // Rename to WHISPER_
41 PRECOMPILE_WHISPER_HEADERS // Rename to WHISPER_
453 DEBUG // Rename to WHISPER_
17 RELEASE // Rename to WHISPER_
891 MULTI_FRAGMENT_APP // Rename to WHISPER_
1 WHISPER // Rename?
// Exports
3 OPENGL_EXPORT // Rename to WHISPER_
4 CORE_EXPORT // Rename to WHISPER_
5 COM_EXPORT // Rename to WHISPER_
5 FILES_EXPORT // Rename to WHISPER_
5 GRAPHICS_EXPORT // Rename to WHISPER_
5 PARSE_EXPORT // Rename to WHISPER_
5 QUESA_EXPORT // Rename to WHISPER_
5 RUNTIME_EXPORT // Rename to WHISPER_
5 UI_EXPORT // Rename to WHISPER_
5 XML_EXPORT // Rename to WHISPER_
3 UI_3D_EXPORT // Rename to WHISPER_ or eliminate
// Misc
1 NULL // Used for nil, which should be eradicated
6 HAS_QUICKTIME // Rename
2 INFINITY // Huh?
2 NAN // Huh?
2 DECLARE_POD // Rename
1 MSIPL_MEMBER_TEMPLATE // Huh?
1 MSIPL_TEMPL_NEWSPEC // Huh?
3 MSIPL_DEBUG_MODE // Huh?
2 MSIPL_DEF_EXPLICIT // Huh?
14 UNIVERSAL_INTERFACES_VERSION // Eliminate
3 XWHISPERHEADER_H // Rename
2 TYPE // Used for DECLARE_POD, OK?
65 GARBAGE_COLLECT_COM // Rename
3 QUESA_SUPPORT_QUICKTIME // huh?
2 STD // Eliminate
6 EXPORT // Used in plugin samples; rename?
552 PRAGMA_MARK // Rename?
2 PRAGMA_EXPORT_SUPPORTED // Rename
4 WHISPER_FRAMEWORK_INCLUDES // Rename
12 WHISPER_OPERATOR_NEW // OK?
The script used to derive this list:
find . \! -path \*Third\ Party\* \(
-name \*.c -print0 -o
-name \*.cpp -print0 -o
-name \*.h -print0 -o
-name \*.inc -print0 -o
-name \*.p -print0 -o
-name \*.pch -print0 -o
-name \*.pch++ -print0 -o
-name \*.r -print0 -o
-name \*.rc -print0
\) | xargs -0 -n 1 cat
| tr '\r' '\n'
| grep '^[[:space:]]*#'
| perl -n -e '
while (/[^_0-9A-Z]([_A-Z][_0-9A-Z]+)([^_0-9A-Za-z].*)/){
print "${1}\n"; $_ = $2;
}'
| sort
| uniq -c
| sort -n > /Software/Whisper/defines
--
<http://web.meeroh.org/> | KB1FMP
A: Because it reverses the logical flow of conversation.
Q: Why is top posting frowned upon? |