[LuaJIT] Allow MIPS64 support
[feed/packages.git] / libs / libimobiledevice / patches / 010-format.patch
1 From ec2bba4ffe5a0939ba192b014ba594eaa964412f Mon Sep 17 00:00:00 2001
2 From: Rosen Penev <rosenp@gmail.com>
3 Date: Sun, 8 Dec 2019 15:45:19 -0800
4 Subject: [PATCH] idevicedate: Fix -Wformat=2 warning
5
6 Format functions expect a constant expression, not a variable.
7
8 Simplified the code slightly.
9 ---
10 tools/idevicedate.c | 17 ++++-------------
11 1 file changed, 4 insertions(+), 13 deletions(-)
12
13 diff --git a/tools/idevicedate.c b/tools/idevicedate.c
14 index 4de90b63..6dddc185 100644
15 --- a/tools/idevicedate.c
16 +++ b/tools/idevicedate.c
17 @@ -38,9 +38,9 @@
18 #include <libimobiledevice/lockdown.h>
19
20 #ifdef _DATE_FMT
21 -#define DATE_FMT_LANGINFO() nl_langinfo (_DATE_FMT)
22 +#define DATE_FMT_LANGINFO nl_langinfo (_DATE_FMT)
23 #else
24 -#define DATE_FMT_LANGINFO() ""
25 +#define DATE_FMT_LANGINFO "%a %b %e %H:%M:%S %Z %Y"
26 #endif
27
28 static void print_usage(int argc, char **argv)
29 @@ -75,7 +75,6 @@ int main(int argc, char *argv[])
30 uint64_t datetime = 0;
31 time_t rawtime;
32 struct tm * tmp;
33 - char const *format = NULL;
34 char buffer[80];
35 int result = 0;
36
37 @@ -131,14 +130,6 @@ int main(int argc, char *argv[])
38 }
39 }
40
41 - /* determine a date format */
42 - if (!format) {
43 - format = DATE_FMT_LANGINFO ();
44 - if (!*format) {
45 - format = "%a %b %e %H:%M:%S %Z %Y";
46 - }
47 - }
48 -
49 ret = idevice_new(&device, udid);
50 if (ret != IDEVICE_E_SUCCESS) {
51 if (udid) {
52 @@ -195,7 +186,7 @@ int main(int argc, char *argv[])
53 tmp = localtime(&rawtime);
54
55 /* finally we format and print the current date */
56 - strftime(buffer, 80, format, tmp);
57 + strftime(buffer, 80, DATE_FMT_LANGINFO, tmp);
58 puts(buffer);
59 } else {
60 datetime = setdate;
61 @@ -217,7 +208,7 @@ int main(int argc, char *argv[])
62
63 if(lockdownd_set_value(client, NULL, "TimeIntervalSince1970", node) == LOCKDOWN_E_SUCCESS) {
64 tmp = localtime(&setdate);
65 - strftime(buffer, 80, format, tmp);
66 + strftime(buffer, 80, DATE_FMT_LANGINFO, tmp);
67 puts(buffer);
68 } else {
69 printf("ERROR: Failed to set date on device.\n");