Changeset 4797

Show
Ignore:
Timestamp:
05/27/07 23:48:49 (2 years ago)
Author:
morris
Message:

Make sure we use l in %d and %u format specifiers since they will be long on 64-bit

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libwired/trunk/libwired/collections/wi-array.c

    r4774 r4797  
    133133        wi_is_equal, 
    134134        wi_description 
    135 }; 
    136  
    137 const wi_array_callbacks_t                              wi_array_null_callbacks = { 
    138         NULL, 
    139         NULL, 
    140         NULL, 
    141         NULL 
    142135}; 
    143136 
     
    447440        wi_uinteger_t           i; 
    448441         
    449         string = wi_string_with_format(WI_STR("<%@ %p>{count = %d, values = (\n"), 
     442        string = wi_string_with_format(WI_STR("<%@ %p>{count = %lu, values = (\n"), 
    450443                wi_runtime_class_name(array), 
    451444                array, 
     
    460453                        description = wi_string_with_format(WI_STR("%p"), data); 
    461454                 
    462                 wi_string_append_format(string, WI_STR("    %u: %@\n"), i, description); 
     455                wi_string_append_format(string, WI_STR("    %lu: %@\n"), i, description); 
    463456        } 
    464457         
  • libwired/trunk/libwired/collections/wi-hash.c

    r4778 r4797  
    161161}; 
    162162 
    163 const wi_hash_key_callbacks_t                   wi_hash_null_key_callbacks = { 
    164         NULL, 
    165         NULL, 
    166         NULL, 
    167         NULL, 
    168         NULL 
    169 }; 
    170  
    171163const wi_hash_value_callbacks_t                 wi_hash_default_value_callbacks = { 
    172164        wi_retain, 
     
    174166        wi_is_equal, 
    175167        wi_description 
    176 }; 
    177  
    178 const wi_hash_value_callbacks_t                 wi_hash_null_value_callbacks = { 
    179         NULL, 
    180         NULL, 
    181         NULL, 
    182         NULL 
    183168}; 
    184169 
     
    346331        wi_uinteger_t           i; 
    347332 
    348         string = wi_string_with_format(WI_STR("<%@ %p>{count = %d, values = (\n"), 
     333        string = wi_string_with_format(WI_STR("<%@ %p>{count = %lu, values = (\n"), 
    349334                wi_runtime_class_name(hash), 
    350335                hash, 
     
    461446         
    462447        if(hash->key_count == 0) 
    463                 return wi_array(); 
     448                return wi_autorelease(wi_array_init(wi_array_alloc())); 
    464449         
    465450        callbacks.retain                = NULL; 
  • libwired/trunk/libwired/collections/wi-set.c

    r4774 r4797  
    136136}; 
    137137 
    138 const wi_set_callbacks_t                                wi_set_null_callbacks = { 
    139         NULL, 
    140         NULL, 
    141         NULL, 
    142         NULL, 
    143         NULL 
    144 }; 
    145  
    146138static wi_uinteger_t                                    _wi_set_buckets_per_page; 
    147139 
     
    301293        wi_uinteger_t           i; 
    302294 
    303         string = wi_string_with_format(WI_STR("<%@ %p>{count = %d, values = (\n"), 
     295        string = wi_string_with_format(WI_STR("<%@ %p>{count = %lu, values = (\n"), 
    304296                wi_runtime_class_name(set), 
    305297                set, 
  • libwired/trunk/libwired/data/wi-date.c

    r4575 r4797  
    107107 
    108108        if(days > 0) { 
    109                 return wi_string_with_format(WI_STR("%u:%.2u:%.2u:%.2u days"), 
     109                return wi_string_with_format(WI_STR("%lu:%.2lu:%.2lu:%.2lu days"), 
    110110                        days, hours, minutes, seconds); 
    111111        } 
    112112        else if(hours > 0) { 
    113                 return wi_string_with_format(WI_STR("%.2u:%.2u:%.2u hours"), 
     113                return wi_string_with_format(WI_STR("%.2lu:%.2lu:%.2lu hours"), 
    114114                        hours, minutes, seconds); 
    115115        } 
    116116        else if(minutes > 0) { 
    117                 return wi_string_with_format(WI_STR("%.2u:%.2u minutes"), 
     117                return wi_string_with_format(WI_STR("%.2lu:%.2lu minutes"), 
    118118                        minutes, seconds); 
    119119        } 
    120120        else { 
    121                 return wi_string_with_format(WI_STR("00:%.2u seconds"), 
     121                return wi_string_with_format(WI_STR("00:%.2lu seconds"), 
    122122                        seconds); 
    123123        } 
  • libwired/trunk/libwired/data/wi-url.c

    r4623 r4797  
    198198         
    199199        if(url->port > 0) 
    200                 wi_string_append_format(url->string, WI_STR(":%u"), url->port); 
     200                wi_string_append_format(url->string, WI_STR(":%lu"), url->port); 
    201201         
    202202        if(url->path) 
  • libwired/trunk/libwired/misc/wi-crypto.c

    r4697 r4797  
    228228        wi_rsa_t                *rsa = instance; 
    229229         
    230         return wi_string_with_format(WI_STR("<%@ %p>{key = %p, bits = %u}"), 
     230        return wi_string_with_format(WI_STR("<%@ %p>{key = %p, bits = %lu}"), 
    231231        wi_runtime_class_name(rsa), 
    232232                rsa, 
     
    527527        wi_cipher_t             *cipher = instance; 
    528528         
    529         return wi_string_with_format(WI_STR("<%@ %p>{name = %@, bits = %u, iv = %@, key = %@}"), 
     529        return wi_string_with_format(WI_STR("<%@ %p>{name = %@, bits = %lu, iv = %@, key = %@}"), 
    530530        wi_runtime_class_name(cipher), 
    531531                cipher, 
  • libwired/trunk/libwired/misc/wi-error.c

    r4698 r4797  
    254254                wi_release(error->string); 
    255255 
    256                 error->string = wi_string_init_with_format(wi_string_alloc(), WI_STR("%s:%u: %s: %s (%u)"), 
     256                error->string = wi_string_init_with_format(wi_string_alloc(), WI_STR("%s:%d: %s: %s (%u)"), 
    257257                        file, 
    258258                        line, 
  • libwired/trunk/libwired/misc/wi-settings.c

    r4679 r4797  
    297297 
    298298static void _wi_settings_log_error(wi_settings_t *settings, wi_string_t *name) { 
    299         wi_log_warn(WI_STR("Could not interpret the setting \"%@\" at %@ line %d: %m"), 
     299        wi_log_warn(WI_STR("Could not interpret the setting \"%@\" at %@ line %lu: %m"), 
    300300                name, settings->file, settings->line); 
    301301} 
  • libwired/trunk/libwired/misc/wi-test.c

    r4777 r4797  
    105105         
    106106        wi_log_info(WI_STR("Tests stopped at %@"), wi_date_string_with_format(_wi_tests_start_date, WI_STR("%Y-%m-%d %H:%M:%S"))); 
    107         wi_log_info(WI_STR("%u %@ passed (%.1f%%), %u failed (%.1f%%) in %.3f seconds"), 
     107        wi_log_info(WI_STR("%lu %@ passed (%.1f%%), %lu failed (%.1f%%) in %.3f seconds"), 
    108108                wi_tests_passed, 
    109109                wi_tests_passed == 1 
  • libwired/trunk/libwired/net/wi-address.c

    r4623 r4797  
    216216        } 
    217217         
    218         return wi_string_with_format(WI_STR("<%@ %p>{family = %@, address = %@, port = %u}"), 
     218        return wi_string_with_format(WI_STR("<%@ %p>{family = %@, address = %@, port = %lu}"), 
    219219           wi_runtime_class_name(address), 
    220220           address, 
  • libwired/trunk/libwired/p7/wi-p7-spec.c

    r4777 r4797  
    737737                                if(wi_hash_data_for_key(p7_spec->types_id, (void *) type->id)) { 
    738738                                        wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, 
    739                                                 WI_STR("Type with id %u (name \"%@\") already exists"), 
     739                                                WI_STR("Type with id %lu (name \"%@\") already exists"), 
    740740                                                type->name, type->id); 
    741741                                         
     
    776776                                if(wi_hash_data_for_key(p7_spec->fields_id, (void *) field->id)) { 
    777777                                        wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, 
    778                                                 WI_STR("Field with id %u (name \"%@\") already exists"), 
     778                                                WI_STR("Field with id %lu (name \"%@\") already exists"), 
    779779                                                field->id, field->name); 
    780780                                         
     
    815815                                if(wi_hash_data_for_key(p7_spec->messages_id, (void *) message->id)) { 
    816816                                        wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, 
    817                                                 WI_STR("Message with id %u (name \"%@\") already exists"), 
     817                                                WI_STR("Message with id %lu (name \"%@\") already exists"), 
    818818                                                message->id, message->name); 
    819819                                         
     
    961961        if(count != other_count) { 
    962962                wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, 
    963                         WI_STR("Transaction \"%@\" should have %u %@, but peer has %u"), 
     963                        WI_STR("Transaction \"%@\" should have %lu %@, but peer has %lu"), 
    964964                        transaction->message->name, 
    965965                        count, 
     
    10921092        if(message->id != other_message->id) { 
    10931093                wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, 
    1094                         WI_STR("Message in reply \"%@\" in transaction \"%@\" should have id %u, but peer has id %u"), 
     1094                        WI_STR("Message in reply \"%@\" in transaction \"%@\" should have id %lu, but peer has id %lu"), 
    10951095                        message->name, transaction->message->name, message->id, other_message->id); 
    10961096                 
     
    11261126                        if(field->id != other_field->id) { 
    11271127                                wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, 
    1128                                         WI_STR("Field in parameter \"%@\" in reply \"%@\" in transaction \"%@\" should have id %u, but peer has id %u"), 
     1128                                        WI_STR("Field in parameter \"%@\" in reply \"%@\" in transaction \"%@\" should have id %lu, but peer has id %lu"), 
    11291129                                        parameter->field->name, message->name, transaction->message->name, field->id, other_field->id); 
    11301130                                 
     
    14291429        _wi_p7_spec_type_t              *type = instance; 
    14301430         
    1431         return wi_string_with_format(WI_STR("<%@ %p>{name = %@, id = %u, size = %u}"), 
     1431        return wi_string_with_format(WI_STR("<%@ %p>{name = %@, id = %lu, size = %lu}"), 
    14321432        wi_runtime_class_name(type), 
    14331433                type, 
     
    15361536        _wi_p7_spec_field_t             *field = instance; 
    15371537         
    1538         return wi_string_with_format(WI_STR("<%@ %p>{name = %@, id = %u, type = %@}"), 
     1538        return wi_string_with_format(WI_STR("<%@ %p>{name = %@, id = %lu, type = %@}"), 
    15391539        wi_runtime_class_name(field), 
    15401540                field, 
     
    16131613        _wi_p7_spec_message_t           *message = instance; 
    16141614         
    1615         return wi_string_with_format(WI_STR("<%@ %p>{name = %@, id = %u, parameters = %@}"), 
     1615        return wi_string_with_format(WI_STR("<%@ %p>{name = %@, id = %lu, parameters = %@}"), 
    16161616        wi_runtime_class_name(message), 
    16171617                message, 
     
    19731973                return WI_STR("one or more times"); 
    19741974 
    1975         return wi_string_with_format(WI_STR("%u %@"), reply->count, (reply->count == 1) ? WI_STR("time") : WI_STR("times")); 
     1975        return wi_string_with_format(WI_STR("%lu %@"), reply->count, (reply->count == 1) ? WI_STR("time") : WI_STR("times")); 
    19761976} 
    19771977 
     
    19891989        _wi_p7_spec_reply_t             *reply = instance; 
    19901990         
    1991         return wi_string_with_format(WI_STR("<%@ %p>{message = %@, count = %u, required = %@}"), 
     1991        return wi_string_with_format(WI_STR("<%@ %p>{message = %@, count = %lu, required = %@}"), 
    19921992        wi_runtime_class_name(reply), 
    19931993                reply, 
  • libwired/trunk/test/tests/wi-runtime-tests.c

    r4669 r4797  
    124124        _wi_runtimetest_t       *runtimetest = instance; 
    125125         
    126         return wi_string_with_format(WI_STR("value=%u"), runtimetest->value); 
     126        return wi_string_with_format(WI_STR("value=%lu"), runtimetest->value); 
    127127} 
    128128