Exemple #1
0
gapi_returnCode_t
kernelCopyInTime (
    const gapi_time_t *from,
    c_time            *to)
{
    gapi_returnCode_t result = GAPI_RETCODE_OK;

    if ( from && to ) {
        if ( gapi_validTime(from) ) {
            to->seconds     = from->sec;
            to->nanoseconds = from->nanosec;
        } else {
            result = GAPI_RETCODE_BAD_PARAMETER;
        }
    } else {
        result = GAPI_RETCODE_BAD_PARAMETER;
    }

    return result;
}
Exemple #2
0
gapi_returnCode_t
kernelCopyInTime (
    const gapi_time_t *from,
    c_time            *to)
{
    gapi_returnCode_t result = GAPI_RETCODE_OK;

    if ( from && to ) {
        if ( (from->sec     ==  GAPI_TIMESTAMP_INVALID_SEC) &&
             (from->nanosec == GAPI_TIMESTAMP_INVALID_NSEC) ) {
            to->seconds     = C_TIME_INVALID.seconds;
            to->nanoseconds = C_TIME_INVALID.nanoseconds;
        } else if ( gapi_validTime(from) ) {
            to->seconds     = from->sec;
            to->nanoseconds = from->nanosec;
        } else {
            result = GAPI_RETCODE_BAD_PARAMETER;
        }
    } else {
        result = GAPI_RETCODE_BAD_PARAMETER;
    }

    return result;
}