I look at what I found in the old code base, and I'm pretty confused.
Here is the function definition:
void vUpdateSequenceDetailsAndIncrement( const CallEvent& roCPEvent, const CallInfo& roCallInfo, BOOL bCreationEvent);
Here it is called:
vUpdateSequenceDetailsAndIncrement(roCPEvent, NULL, FALSE);
Here, NULL is currently passed directly to the roCallInfo
reference parameter. This function ultimately calls:
vTimeChange(*pSeqDetails, roCPEvent, roCallInfo);
which is defined:
void vTimeChange(const SequenceDetails& roSequenceDetails, const CallEvent& roCPEvent, const CallInfo& roCallInfo)
roCallInfo
possibly NULL roCallInfo
to roCallInfo
. I thought NULL could not be passed as a reference? Does anyone know if VC ++ 4.x has any problem that made such code ok? If NULL can be passed as a reference, then what happens when something like this happens in vTimeChange:
roCallInfo.getCallStartTime();
Isn't it dereferencing NULL just as if I were doing
CallInfo * info = NULL; info->getCallStartTime();
? I will probably guard there, and let the compiler delete it if it is not necessary, but I would like to understand how this happens!
Thanks.