mirror of
https://github.com/curl/curl.git
synced 2026-08-25 03:53:31 +03:00
tidy-up: C and CI
- drop redundant casts for `CURL_UNCONST()` pointers (Windows). - GHA/linux: delete redundant/dupe `-g` C flag in memory sanitizer job. Spotted-by: Daniel Stenberg - examples/http2-upload: drop local macro. - examples/http2-upload: drop leading underscore from union name. - examples/http2-upload: drop interim macro. - tests/server/util: reapply patch lost in a rebase. - sync `main()` declarations across the codebase. Closes #22559
This commit is contained in:
parent
35843dd635
commit
8a8ff47b63
37 changed files with 59 additions and 68 deletions
|
|
@ -67,20 +67,18 @@
|
|||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define gettimeofday(a, b) my_gettimeofday(a, b)
|
||||
static int my_gettimeofday(struct timeval *tp, void *tzp)
|
||||
static int gettimeofday(struct timeval *tp, void *tzp)
|
||||
{
|
||||
(void)tzp;
|
||||
if(tp) {
|
||||
/* Offset between 1601-01-01 and 1970-01-01 in 100 nanosec units */
|
||||
#define WIN32_FT_OFFSET 116444736000000000
|
||||
union {
|
||||
CURL_TYPEOF_CURL_OFF_T ns100; /* time since 1 Jan 1601 in 100ns units */
|
||||
FILETIME ft;
|
||||
} _now;
|
||||
GetSystemTimeAsFileTime(&_now.ft);
|
||||
tp->tv_usec = (long)((_now.ns100 / 10) % 1000000);
|
||||
tp->tv_sec = (long)((_now.ns100 - WIN32_FT_OFFSET) / 10000000);
|
||||
} now;
|
||||
GetSystemTimeAsFileTime(&now.ft);
|
||||
tp->tv_usec = (long)((now.ns100 / 10) % 1000000);
|
||||
/* subtract offset between 1601-01-01 and 1970-01-01 in 100ns units */
|
||||
tp->tv_sec = (long)((now.ns100 - 116444736000000000) / 10000000);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -286,7 +284,7 @@ static int setup(struct input *t, int num, const char *upload)
|
|||
/*
|
||||
* Upload all files over HTTP/2, using the same physical connection!
|
||||
*/
|
||||
int main(int argc, const char **argv)
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
CURLcode result;
|
||||
struct input *trans;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue