1
0
mirror of https://github.com/lammertb/libhttp.git synced 2026-01-03 16:02:30 +03:00

Re-format source

This commit is contained in:
bel
2016-03-21 22:44:49 +01:00
parent 6a5cdc470e
commit 1ef0bc06c1
2 changed files with 9 additions and 9 deletions

View File

@@ -3581,8 +3581,7 @@ get_random(void)
/* lfsr will be only 0 if has not been initialized,
* so this code is called only once. */
lfsr = (((uint64_t)now.tv_sec) << 21) ^ ((uint64_t)now.tv_nsec)
^ ((uint64_t)(ptrdiff_t)&now)
^ (((uint64_t)time(NULL)) << 33);
^ ((uint64_t)(ptrdiff_t)&now) ^ (((uint64_t)time(NULL)) << 33);
lcg = (((uint64_t)now.tv_sec) << 25) + (uint64_t)now.tv_nsec
+ (uint64_t)(ptrdiff_t)&now;
} else {
@@ -10526,12 +10525,12 @@ ssl_id_callback(void)
}
return tls->thread_idx;
} else {
/* pthread_t may be any data type, so a simple cast to unsigned long
* can rise a warning/error, depending on the platform.
* Here memcpy is used as an anything-to-anything cast. */
unsigned long ret = 0;
pthread_t t = pthread_self();
memcpy(&ret, &t, sizeof(pthread_t));
/* pthread_t may be any data type, so a simple cast to unsigned long
* can rise a warning/error, depending on the platform.
* Here memcpy is used as an anything-to-anything cast. */
unsigned long ret = 0;
pthread_t t = pthread_self();
memcpy(&ret, &t, sizeof(pthread_t));
return ret;
}

View File

@@ -35,7 +35,7 @@
#if defined(_WIN32)
#include <Windows.h>
#define test_sleep(x) (Sleep(x * 1000))
#define test_sleep(x) (Sleep((x)*1000))
#else
#include <unistd.h>
#define test_sleep(x) (sleep(x))
@@ -863,6 +863,7 @@ START_TEST(test_request_handlers)
ck_assert(ri != NULL);
ck_assert_str_eq(ri->uri, "200");
i = mg_read(client_conn, buf, sizeof(buf));
ck_assert(i < sizeof(buf));
ck_assert_int_eq(i, (int)strlen(expected));
buf[i] = 0;
ck_assert_str_eq(buf, expected);