Generic programming question

May 20, 2008
9,910
71
Syracuse, NY, USA
I could implement either of these with little change elsewhere and with the same result.

Code:
ULONGLONG LocalDateTimeToUTCFileTime( LPWSTR szDateTime )

BOOL LocalDateTimeToUTCFileTime( LPWSTR szDateTime, ULONGLONG *pftDueUTC )
The first, and one call to it, requires 32 fewer bytes in .text while the second seems more in keeping with the MS way of doing things and avoids passing 64-bit values (inefficient on a 32-bit machine?).

Is one preferred over the other? Thanks.
 
Jun 26, 2008
38
1
> ULONGLONG LocalDateTimeToUTCFileTime( LPWSTR szDateTime )
>
> BOOL LocalDateTimeToUTCFileTime( LPWSTR szDateTime, ULONGLONG *pftDueUTC )
[...]

> Is one preferred over the other? Â*Thanks.
If LocalDateTimeToUTCFileTime can fail, the second one should be preferred.

Â* Â* Juanma
 
May 20, 2008
9,910
71
Syracuse, NY, USA
On Sat, 02 Apr 2011 15:23:40 -0400, you wrote:

|---Quote---
|> ULONGLONG LocalDateTimeToUTCFileTime( LPWSTR szDateTime )
|>
|> BOOL LocalDateTimeToUTCFileTime( LPWSTR szDateTime, ULONGLONG *pftDueUTC )
|---End Quote---
|[...]
|
|
|---Quote---
|> Is one preferred over the other?
|---End Quote---

|If LocalDateTimeToUTCFileTime can fail, the second one should be preferred.

In the first form, a return of 0 indicates failure. I have no problem with
that.