static int bool_log_context_property_type_to_string()

in v2/src/log_context_property_bool_type.c [16:33]


static int bool_log_context_property_type_to_string(const void* property_value, char* buffer, size_t buffer_length)
{
    int result;
    /* Codes_SRS_LOG_CONTEXT_PROPERTY_BOOL_TYPE_07_001: [ If property_value is NULL, LOG_CONTEXT_PROPERTY_TYPE_IF_IMPL(bool).to_string shall fail and return a negative value. ]*/
    if (property_value == NULL)
    {
        (void)printf("Invalid arguments: const void* property_value=%p, char* buffer=%p, size_t buffer_length=%zu\r\n", property_value, buffer, buffer_length);
        result = -1;
    }
    else
    {
    /* Codes_SRS_LOG_CONTEXT_PROPERTY_BOOL_TYPE_07_002: [ LOG_CONTEXT_PROPERTY_TYPE_IF_IMPL(bool).to_string shall call snprintf with buffer, buffer_length and format string PRI_BOOL and pass in the values list the bool value pointed to be property_value. ]*/
    /* Codes_SRS_LOG_CONTEXT_PROPERTY_BOOL_TYPE_07_003: [ LOG_CONTEXT_PROPERTY_TYPE_IF_IMPL(bool).to_string shall succeed and return the result of snprintf. ]*/
    /* Codes_SRS_LOG_CONTEXT_PROPERTY_BOOL_TYPE_07_004: [ If any error is encountered, LOG_CONTEXT_PROPERTY_TYPE_IF_IMPL(bool).to_string shall fail and return a negative value. ]*/
        result = snprintf(buffer, buffer_length, "%" PRI_BOOL, MU_BOOL_VALUE (*(bool*)property_value));
    }
    return result;
}