Mercurial > pidgin.yaz
comparison libpurple/util.c @ 32752:5525312cf589
Upgrade PurpleXfer for a 64-bit world.
Prpls and UIs still need to handle this properly though.
Refs #1185.
Refs #8477.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sun, 16 Oct 2011 04:38:12 +0000 |
parents | 4c64383f05cc |
children | 4a34689eeb33 |
comparison
equal
deleted
inserted
replaced
32751:8b7c7c6bf985 | 32752:5525312cf589 |
---|---|
3329 | 3329 |
3330 return ret; | 3330 return ret; |
3331 } | 3331 } |
3332 | 3332 |
3333 char * | 3333 char * |
3334 purple_str_size_to_units(size_t size) | 3334 purple_str_size_to_units(goffset size) |
3335 { | 3335 { |
3336 static const char * const size_str[] = { "bytes", "KiB", "MiB", "GiB" }; | 3336 static const char * const size_str[] = { "bytes", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB" }; |
3337 float size_mag; | 3337 float size_mag; |
3338 int size_index = 0; | 3338 int size_index = 0; |
3339 | 3339 |
3340 if (size == -1) { | 3340 if (size == -1) { |
3341 return g_strdup(_("Calculating...")); | 3341 return g_strdup(_("Calculating...")); |
3344 return g_strdup(_("Unknown.")); | 3344 return g_strdup(_("Unknown.")); |
3345 } | 3345 } |
3346 else { | 3346 else { |
3347 size_mag = (float)size; | 3347 size_mag = (float)size; |
3348 | 3348 |
3349 while ((size_index < 3) && (size_mag > 1024)) { | 3349 while ((size_index < G_N_ELEMENTS(size_str) - 1) && (size_mag > 1024)) { |
3350 size_mag /= 1024; | 3350 size_mag /= 1024; |
3351 size_index++; | 3351 size_index++; |
3352 } | 3352 } |
3353 | 3353 |
3354 if (size_index == 0) { | 3354 if (size_index == 0) { |