1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Generic programming question

Discussion in 'Plugins' started by vefatica, Apr 2, 2011.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,934
    Likes Received:
    30
    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.
     
  2. Juanma Barranquero

    Joined:
    Jun 26, 2008
    Messages:
    38
    Likes Received:
    1
    [...]

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

    Â* Â* Juanma
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,934
    Likes Received:
    30
    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.
     

Share This Page