ObjFW  History of src/of_asprintf.m of 773997d0720206b2

History of the file that is called src/of_asprintf.m at check-in 773997d0720206b2

2024-04-29
21:42
[862e4e73cc] part of check-in [f16bccc7b3] Properly hide private symbols (check-in: [f16bccc7b3] user: js, branch: trunk, size: 17123) [annotate] [blame] [check-ins using] [diff]
2024-04-03
02:16
[e60e10983b] part of check-in [7413a728a7] Change license to LGPLv3 only (check-in: [7413a728a7] user: js, branch: trunk, size: 17120) [annotate] [blame] [check-ins using] [diff]
2024-01-02
17:17
[164c33d955] part of check-in [26ddd2e4e4] Update copyright (check-in: [26ddd2e4e4] user: js, branch: trunk, size: 16912) [annotate] [blame] [check-ins using] [diff]
2023-08-23
13:54
[ebfc63953a] part of check-in [ff64ec30f4] OFStrFTime: Don't use OFASPrintF() (check-in: [ff64ec30f4] user: js, branch: trunk, size: 16912) [annotate] [blame] [check-ins using] [diff]
12:44
[1c0f37cece] part of check-in [05d675eb07] Add OFStrFTime() consistent with OFStrPTime() (check-in: [05d675eb07] user: js, branch: trunk, size: 17114) [annotate] [blame] [check-ins using] [diff]
2023-04-10
14:33
[84a6c0408a] part of check-in [6e786896e0] Fall back to uselocale() if it's available (check-in: [6e786896e0] user: js, branch: trunk, size: 16889) [annotate] [blame] [check-ins using] [diff]
2023-01-06
09:04
[ee2ef84a44] part of check-in [8939cbdb52] Update copyright (check-in: [8939cbdb52] user: js, branch: trunk, size: 16257) [annotate] [blame] [check-ins using] [diff]
2022-09-29
20:27
[882db55cea] part of check-in [915bfc7431] OFLocale: Rename a few methods (check-in: [915bfc7431] user: js, branch: trunk, size: 16257) [annotate] [blame] [check-ins using] [diff]
2022-02-12
07:46
[31044637f2] part of check-in [1a86b8175b] Update copyright (check-in: [1a86b8175b] user: js, branch: trunk, size: 16253) [annotate] [blame] [check-ins using] [diff]
2021-05-02
09:25
[55b5185ec7] part of check-in [19236ddfe7] A few more missed renames (check-in: [19236ddfe7] user: js, branch: trunk, size: 16253) [annotate] [blame] [check-ins using] [diff]
2021-04-25
19:58
[88da2745a9] part of check-in [6ae98c1dcf] Last round of renames (hopefully) (check-in: [6ae98c1dcf] user: js, branch: trunk, size: 16253) [annotate] [blame] [check-ins using] [diff]
11:05
[2d355cbec1] part of check-in [27103855c2] A few last renames (check-in: [27103855c2] user: js, branch: new-naming-convention, size: 16253) [annotate] [blame] [check-ins using] [diff]
2021-04-18
22:56
[700e7dd91c] part of check-in [e73c65a849] Rename all symbols marked extern (check-in: [e73c65a849] user: js, branch: new-naming-convention, size: 16263) [annotate] [blame] [check-ins using] [diff]
20:51
Renamed src/of_asprintf.m → src/OFASPrintF.m. [44b0400cd9] part of check-in [35de667566] Rename everything in several smaller files (check-in: [35de667566] user: js, branch: new-naming-convention, size: 16272) [annotate] [blame] [check-ins using] [diff]
2021-04-17
01:32
[32debbce88] part of check-in [2d3790870d] of_unichar_t -> OFUnichar (check-in: [2d3790870d] user: js, branch: new-naming-convention, size: 16620) [annotate] [blame] [check-ins using] [diff]
2021-01-31
15:16
[d2e16772ed] part of check-in [07f4a82038] of_asprintf: Fix type mismatch on LP64 systems (check-in: [07f4a82038] user: js, branch: trunk, size: 16629) [annotate] [blame] [check-ins using] [diff]
2021-01-14
01:45
[489f8ebee0] part of check-in [99862df65a] Fix fallback asprintf implementation for length 0 (check-in: [99862df65a] user: js, branch: trunk, size: 16602) [annotate] [blame] [check-ins using] [diff]
2021-01-02
22:06
[bdf6534c80] part of check-in [27b401c7c2] Update copyright (check-in: [27b401c7c2] user: js, branch: amiga-library, size: 16784) [annotate] [blame] [check-ins using] [diff]
22:04
[f0147f7049] part of check-in [374e1a1bfa] Update copyright (check-in: [374e1a1bfa] user: js, branch: trunk, size: 16601) [annotate] [blame] [check-ins using] [diff]
2021-01-01
22:38
[7048f84bee] part of check-in [1ba0dc33b4] of_asprintf: Work around %j & %t missing on HP-UX (check-in: [1ba0dc33b4] user: js, branch: trunk, size: 16690) [annotate] [blame] [check-ins using] [diff]
22:34
[00ae3c010b] part of check-in [8c41063a76] of_asprintf: Work around %z missing on HP-UX (check-in: [8c41063a76] user: js, branch: trunk, size: 16650) [annotate] [blame] [check-ins using] [diff]
18:36
[35d52654ca] part of check-in [7267f55840] Better fallback asprintf() implementation

Instead of trying if it's C99 compliant and falling back to a 64 KB
buffer if it is not, resize the buffer in powers of 2 until it fits.

The problem is that some implementations that are not compliant with C99
don't just return -1 for a length of 0, but actually crash (e.g. HP-UX). (check-in: [7267f55840] user: js, branch: trunk, size: 16630) [annotate] [blame] [check-ins using] [diff]

2020-05-16
17:17
[cd42320784] part of check-in [ecca609079] Don't use %I on Windows

Older versions only understand I64. So only use I64 where appropriate
and drop it entirely where not. (check-in: [ecca609079] user: js, branch: trunk, size: 16873) [annotate] [blame] [check-ins using] [diff]

16:46
[36d94b6a4d] part of check-in [c5beed7277] Do not require snprintf to return expected length (check-in: [c5beed7277] user: js, branch: trunk, size: 16808) [annotate] [blame] [check-ins using] [diff]
2020-03-09
00:54
[0f7da4996c] part of check-in [e0b659378f] of_asprintf.m: Small optimization

Don't replace the decimal point with "." if the decimal point is ".". (check-in: [e0b659378f] user: js, branch: trunk, size: 16235) [annotate] [blame] [check-ins using] [diff]

2020-01-02
01:51
[04c9933717] part of check-in [c7f0229795] Update copyright (check-in: [c7f0229795] user: js, branch: trunk, size: 16189) [annotate] [blame] [check-ins using] [diff]
2019-03-08
00:35
[53badc787e] part of check-in [bceb7ed4c9] Use dot syntax (check-in: [bceb7ed4c9] user: js, branch: trunk, size: 16186) [annotate] [blame] [check-ins using] [diff]
2019-01-03
19:13
[3f7a200743] part of check-in [0509d7a844] Update copyright (check-in: [0509d7a844] user: js, branch: trunk, size: 16194) [annotate] [blame] [check-ins using] [diff]
2018-07-28
18:45
[b4c808b218] part of check-in [aa0384d1bf] Rename OFLocalization -> OFLocale (check-in: [aa0384d1bf] user: js, branch: trunk, size: 16188) [annotate] [blame] [check-ins using] [diff]
2018-01-03
19:49
[bda9482e58] part of check-in [7e5c81e186] Update copyright notice (check-in: [7e5c81e186] user: js, branch: trunk, size: 16208) [annotate] [blame] [check-ins using] [diff]
2017-08-11
15:47
[e20ce9de33] part of check-in [17098e76eb] of_asprintf: Don't require set up OFLocalization (check-in: [17098e76eb] user: js, branch: trunk, size: 16185) [annotate] [blame] [check-ins using] [diff]
2017-06-03
18:37
[3e2fecec3f] part of check-in [4ec0948b1b] Properly check for sys/types.h (check-in: [4ec0948b1b] user: js, branch: trunk, size: 16163) [annotate] [blame] [check-ins using] [diff]
2017-05-07
20:10
[dfdbe062d8] part of check-in [4af49a13c3] Small code style change

Casts are now written like types in variable declarations. (check-in: [4af49a13c3] user: js, branch: trunk, size: 16128) [annotate] [blame] [check-ins using] [diff]

2017-05-06
22:06
[eefc8c03cc] part of check-in [13768d7743] configure: Check for wchar_t and wchar.h (check-in: [13768d7743] user: js, branch: trunk, size: 16122) [annotate] [blame] [check-ins using] [diff]
2017-04-02
01:06
[81c730c736] part of check-in [d07c56a8bb] Add OF_CONSTRUCTOR() / OF_DESTRUCTOR() (check-in: [d07c56a8bb] user: js, branch: trunk, size: 16036) [annotate] [blame] [check-ins using] [diff]
2017-03-12
01:33
[c0ebec1591] part of check-in [df2ee1f2f9] Fix using asprintf_l (check-in: [df2ee1f2f9] user: js, branch: trunk, size: 16071) [annotate] [blame] [check-ins using] [diff]
2017-01-09
17:36
[096a7db2b7] part of check-in [44f45c2e35] Update copyright

Forgot to add 2017, even though I already did quite some changes in
2017. (check-in: [44f45c2e35] user: js, branch: trunk, size: 16175) [annotate] [blame] [check-ins using] [diff]

06:26
[5de6ff2576] part of check-in [06bcb21fc7] Add OFLocalization

This singleton gives access to all things locale, including the ability
to get localized strings.

This also adds the OF_LOCALIZED() macro. Its first argument is an ID for
the string to be localized and its second argument is the fallback
string to be used if it cannot retrieve the localized string. Following
that are variable name / value pairs to be replaced in the localized
string.

Getting translated strings is not implemented yet: Instead, it always
uses the fallback string.

This also switches ofhttp to localized strings. (check-in: [06bcb21fc7] user: js, branch: trunk, size: 16169) [annotate] [blame] [check-ins using] [diff]

2017-01-07
03:26
[78991846e2] part of check-in [0ad678f125] Use strtof_l, strtod_l and asprintf_l if available

This avoids the hacks introduced in the previous commit, if those
functions are available. (check-in: [0ad678f125] user: js, branch: trunk, size: 16165) [annotate] [blame] [check-ins using] [diff]

02:34
[91cd8b629a] part of check-in [6dff0f5922] Always use "." for the decimal point

This is achieved by replacing the locale's decimal point with "." after
formatting and replacing "." with the locale's decimal point before
parsing.

To still use the decimal point from the locale for formatting, the new
flag "," is introduced to formats. This is useful for just printing a
string to the user that is not saved to a file or sent via a network.

While this is an ugly hack, there is no better way to do this other than
implementing the functionality of printf and strtod myself, as POSIX
does not specify versions of these that take a locale as an argument.
While this is a lot of work and error-prone, I will most likely end up
doing this eventually.

This commit also enables the locale in OFApplication to notice when
things break. As a nice side effect, ofhttp now uses the locale's
decimal point in its user interface. (check-in: [6dff0f5922] user: js, branch: trunk, size: 15256) [annotate] [blame] [check-ins using] [diff]

2016-02-21
15:37
[bff5bd9808] part of check-in [e0b9167693] Make use of C99-style for loops (check-in: [e0b9167693] user: js, branch: trunk, size: 14348) [annotate] [blame] [check-ins using] [diff]
2016-01-03
00:43
[d2c505f580] part of check-in [cec0f072f8] Update copyright

While at it, also update the mail address. (check-in: [cec0f072f8] user: js, branch: 0.8, size: 14318) [annotate] [blame] [check-ins using] [diff]

00:41
[45f853ae7d] part of check-in [2a27cf3000] Update copyright

While at it, also update the mail address. (check-in: [2a27cf3000] user: js, branch: trunk, size: 14338) [annotate] [blame] [check-ins using] [diff]

2015-10-19
22:15
[4c2fb9e2fa] part of check-in [1ba08eebc5] Add platform.h & make platform defines consistent (check-in: [1ba08eebc5] user: js, branch: trunk, size: 14334) [annotate] [blame] [check-ins using] [diff]
2015-09-17
21:19
[7771a499a7] part of check-in [719ec38eb0] Fix compilation for PSP (check-in: [719ec38eb0] user: js, branch: trunk, size: 14314) [annotate] [blame] [check-ins using] [diff]
2015-01-03
20:57
[e5f48e3c7d] part of check-in [cfd374b906] Update copyright (check-in: [cfd374b906] user: js, branch: trunk, size: 14050) [annotate] [blame] [check-ins using] [diff]
2014-08-06
00:04
[a27170a922] part of check-in [ddbbd50e56] Don't export (v)asprintf implementation

In case (v)asprintf was missing, this was exported instead of only being
used internally, potentially causing problems when linking against
another library which also detected libc is missing it. (check-in: [ddbbd50e56] user: js, branch: trunk, size: 14044) [annotate] [blame] [check-ins using] [diff]

2014-06-21
21:43
[6eaf017199] part of check-in [13ee56edf3] Move all macros from OFObject.h to macros.h

This means that OFObject.h imports macros.h now, making it unnecessary
to manually import macros.h in almost every file. And while at it, also
import autorelease.h in OFObject.h, so that this doesn't need to be
manually imported in almost every file as well. (check-in: [13ee56edf3] user: js, branch: trunk, size: 13463) [annotate] [blame] [check-ins using] [diff]

2014-05-15
01:50
[db322fe9c1] part of check-in [17be12b6e5] Don't define _*_SOURCE

Instead, just define _GNU_SOURCE when __GLIBC__ is defined. After all,
that's the only libc that doesn't work properly without any defines. (check-in: [17be12b6e5] user: js, branch: trunk, size: 13506) [annotate] [blame] [check-ins using] [diff]

2014-04-26
01:02
[b1b058c113] part of check-in [1bf25c9a98] of_asprintf: Generalize some #ifdefs

All workarounds that were for Wii and PSP are caused by newlib, so it's
better to check for newlib instead. (check-in: [1bf25c9a98] user: js, branch: trunk, size: 13527) [annotate] [blame] [check-ins using] [diff]

2014-02-13
23:26
[9e4f7d3917] part of check-in [2f5af58573] Use -std=c11 instead of -std=gnu11

Not using -std=gnu11 means _GNU_SOURCE does not get defined anymore,
therefore this commit also adds the required feature defines for glibc.

Additionally, this adds of_strdup in macros.h, as strdup is an
extension. (check-in: [2f5af58573] user: js, branch: trunk, size: 13554) [annotate] [blame] [check-ins using] [diff]

2014-01-04
00:24
[0550f8c820] part of check-in [3b97fc3cd9] Update copyright. (check-in: [3b97fc3cd9] user: js, branch: trunk, size: 13553) [annotate] [blame] [check-ins using] [diff]
2013-11-24
17:28
[ceb4eae89b] part of check-in [4b56450a24] of_asprintf: Change %k to %C and %K to %S.

This reverts 2943b43. It turned out that using %C and %S is possible,
even when mixing code with Cocoa code, as it is possible to introduce
__attribute__((format(__OFString__, ...))) to Clang which just handles
%C and %S as being of_unichar_t instead of unichar like they are handled
for __attribute__((format(__NSString__, ...))).

The Clang patch for __attribute__((format(__OFString__, ...))) has been
submitted, but is not upstream yet, thus the changes for that are not
being committed yet. (check-in: [4b56450a24] user: js, branch: trunk, size: 13547) [annotate] [blame] [check-ins using] [diff]

2013-11-23
17:48
[0045836345] part of check-in [945ff1043d] of_asprintf: Add %K format specifier.

%K is for const of_unichar_t*. (check-in: [945ff1043d] user: js, branch: trunk, size: 13547) [annotate] [blame] [check-ins using] [diff]

03:24
[3466f7d906] part of check-in [5eada9f7b0] of_asprintf: Change %C to %k.

In Cocoa, %C means unichar, which is unsigned short and thus compilers
expect %C to be unichar when the language is set to ObjC. It would be
hard to let compilers detect whether %C should be unichar or
of_unichar_t, especially when mixing ObjFW and Cocoa code, thus the
change to %k. (check-in: [5eada9f7b0] user: js, branch: trunk, size: 12902) [annotate] [blame] [check-ins using] [diff]

03:02
[7dd06b0a1f] part of check-in [0232e0c975] of_asprintf: Don't accept length modifiers for %@.

Same for %C. (check-in: [0232e0c975] user: js, branch: trunk, size: 12902) [annotate] [blame] [check-ins using] [diff]

2013-11-22
19:27
[0f6776e0aa] part of check-in [e803913a9d] of_asprintf: Add %C format specifier. (check-in: [e803913a9d] user: js, branch: trunk, size: 12764) [annotate] [blame] [check-ins using] [diff]
18:23
[fa426a4240] part of check-in [619cced011] of_asprintf.m: Fix coding style.

This file still used the very old coding style. (check-in: [619cced011] user: js, branch: trunk, size: 12393) [annotate] [blame] [check-ins using] [diff]

2013-06-26
17:18
[aad6d97af9] part of check-in [530decab01] Revive the PSP port. (check-in: [530decab01] user: js, branch: trunk, size: 12534) [annotate] [blame] [check-ins using] [diff]
2013-04-27
02:22
[2e133e3806] part of check-in [2713b481a1] Initial Wii port.

Threads and sockets still missing. (check-in: [2713b481a1] user: js, branch: trunk, size: 12483) [annotate] [blame] [check-ins using] [diff]

2013-01-09
22:24
[1e3eba5867] part of check-in [813c00ccf0] Update copyright. (check-in: [813c00ccf0] user: js, branch: trunk, size: 12233) [annotate] [blame] [check-ins using] [diff]
2012-10-15
11:08
[e1cad94c32] part of check-in [06251136e5] Fix some forgotten renames. (check-in: [06251136e5] user: js, branch: trunk, size: 12227) [annotate] [blame] [check-ins using] [diff]
2012-10-08
08:12
[a758901adf] part of check-in [9276a1c3c8] Coding style. (check-in: [9276a1c3c8] user: js, branch: trunk, size: 12224) [annotate] [blame] [check-ins using] [diff]
2012-08-19
23:26
[31d446cae5] part of check-in [5f04d5b720] Get rid of OFAutoreleasePool in of_asprintf. (check-in: [5f04d5b720] user: js, branch: trunk, size: 12057) [annotate] [blame] [check-ins using] [diff]
2012-04-03
17:53
[2b51c08162] part of check-in [d0f8cffed5] Add a missing include. (check-in: [d0f8cffed5] user: js, branch: trunk, size: 12076) [annotate] [blame] [check-ins using] [diff]
2012-01-05
00:56
[72b4dbe204] part of check-in [ce70e17b38] Update copyright. (check-in: [ce70e17b38] user: js, branch: trunk, size: 12057) [annotate] [blame] [check-ins using] [diff]
2011-12-26
16:24
[231103bb7a] part of check-in [fa81b2657c] Fix exception handling in of_asprintf. (check-in: [fa81b2657c] user: js, branch: trunk, size: 12051) [annotate] [blame] [check-ins using] [diff]
2011-11-23
02:17
[3dba5d325a] part of check-in [ccb0a96ebc] of_asprintf: Work around more Win32 brokenness. (check-in: [ccb0a96ebc] user: js, branch: trunk, size: 12110) [annotate] [blame] [check-ins using] [diff]
2011-09-22
23:25
[d33bc3adcc] part of check-in [e1e7ffa903] Exceptions are now autoreleased.

This is safe as an "exception loop" can't happen, since if allocating
an exception fails, it throws an OFAllocFailedException which is
preallocated and can always be thrown.

So, the worst case would be that an autorelease of an exception fails,
triggering an OFOutOfMemoryException for which there is no memory,
resulting in an OFAllocFailedException to be thrown. (check-in: [e1e7ffa903] user: js, branch: trunk, size: 11946) [annotate] [blame] [check-ins using] [diff]

2011-09-12
19:57
[31524fd43b] part of check-in [e6fd39d11e] Rename -[cString] to -[UTF8String]. (check-in: [e6fd39d11e] user: js, branch: trunk, size: 11962) [annotate] [blame] [check-ins using] [diff]
2011-07-17
02:11
[6a4139bc4d] part of check-in [e9768d31bb] Include sys/types.h in of_asprintf.m. (check-in: [e9768d31bb] user: js, branch: 0.5, size: 11229) [annotate] [blame] [check-ins using] [diff]
02:11
[e1e1de1e89] part of check-in [506c012ec2] Include sys/types.h in of_asprintf.m. (check-in: [506c012ec2] user: js, branch: trunk, size: 11947) [annotate] [blame] [check-ins using] [diff]
2011-06-30
23:28
[ff2c736c3a] part of check-in [c7c8a3e053] Fix wrong variable names resulting from backport. (check-in: [c7c8a3e053] user: js, branch: 0.5, size: 11205) [annotate] [blame] [check-ins using] [diff]
20:50
[379e3421b7] part of check-in [4075c85e25] of_asprintf: Work around Win32 breaking C99 standard length modifiers. (check-in: [4075c85e25] user: js, branch: 0.5, size: 11008) [annotate] [blame] [check-ins using] [diff]
2011-06-26
00:45
[e3742f904d] part of check-in [3092cda94b] Handle q length modifier in of_asprintf on iOS. (check-in: [3092cda94b] user: js, branch: 0.5, size: 11217) [annotate] [blame] [check-ins using] [diff]
00:45
[5101db410e] part of check-in [58f7af5290] Handle q length modifier in of_asprintf on iOS. (check-in: [58f7af5290] user: js, branch: trunk, size: 11923) [annotate] [blame] [check-ins using] [diff]
2011-06-16
01:05
[0950c4780b] part of check-in [6c20d8bff4] of_asprintf: Work around Win32 breaking C99 standard length modifiers. (check-in: [6c20d8bff4] user: js, branch: trunk, size: 11714) [annotate] [blame] [check-ins using] [diff]
2011-04-23
00:11
[e2f58222ca] part of check-in [d8c31454b4] More style improvements. (check-in: [d8c31454b4] user: js, branch: trunk, size: 11179) [annotate] [blame] [check-ins using] [diff]
2011-03-22
00:55
[983a2f4cc6] part of check-in [6d4dfb5bc7] Add -Wshorten-64-to-32. (check-in: [6d4dfb5bc7] user: js, branch: trunk, size: 10503) [annotate] [blame] [check-ins using] [diff]
2011-02-19
13:14
[7a9c826b78] part of check-in [5fdaa5b909] of_asprintf: Use format even if object is nil. (check-in: [5fdaa5b909] user: js, branch: trunk, size: 10397) [annotate] [blame] [check-ins using] [diff]
2011-02-07
21:05
[ca529b4e62] part of check-in [151463e32a] of_vasprintf: Preserve exceptions that happen in -[description]. (check-in: [151463e32a] user: js, branch: trunk, size: 10402) [annotate] [blame] [check-ins using] [diff]
2011-02-06
15:11
[0c6c3ac0b6] part of check-in [578e7598a8] Add missing include. (check-in: [578e7598a8] user: js, branch: trunk, size: 10454) [annotate] [blame] [check-ins using] [diff]
2011-02-05
14:47
[8bf00513bd] part of check-in [a0ff17e12b] Make sure we always have a return buffer in of_asprintf. (check-in: [a0ff17e12b] user: js, branch: trunk, size: 10434) [annotate] [blame] [check-ins using] [diff]
2011-02-02
17:38
[75df7de9af] part of check-in [1dcfbcb479] Work around some annoying compiler bugs. (check-in: [1dcfbcb479] user: js, branch: trunk, size: 10576) [annotate] [blame] [check-ins using] [diff]
2011-01-31
23:15
[6358474411] part of check-in [41af19cfbc] Work around glibc weirdness. (check-in: [41af19cfbc] user: js, branch: trunk, size: 10573) [annotate] [blame] [check-ins using] [diff]
22:35
[ebb2514163] part of check-in [f17bdd0722] wint_t might be smaller than int so that integer promotions apply. (check-in: [f17bdd0722] user: js, branch: trunk, size: 10553) [annotate] [blame] [check-ins using] [diff]
2011-01-30
00:24
[07a6d8ae59] part of check-in [e9c2c2c599] Allow nil for %@. (check-in: [e9c2c2c599] user: js, branch: trunk, size: 10443) [annotate] [blame] [check-ins using] [diff]
2011-01-29
19:01
Added: [939c56bbd9] part of check-in [4c4608fbba] Add of_asprintf and allow %@ in format strings. (check-in: [4c4608fbba] user: js, branch: trunk, size: 10366) [annotate] [blame] [check-ins using]