mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-13 17:00:19 +00:00
clang-format more stuff in common
PUBLISHED_FROM=8b5c6f70d5582402f327c4da7baee7cc15ee13aa
This commit is contained in:
1 parent
fd45a6d31b
commit
97fe505bb4
2 files changed
+27
-21
No files matched your search
+20
-13
@@ -11148,7 +11148,8 @@ int gettimeofday(struct timeval *tp, void *tzp) {
|
|||||||
* All rights reserved
|
* All rights reserved
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if (CS_PLATFORM == CS_P_NRF51 || CS_PLATFORM == CS_P_NRF52) && defined(__ARMCC_VERSION)
|
#if (CS_PLATFORM == CS_P_NRF51 || CS_PLATFORM == CS_P_NRF52) && \
|
||||||
|
defined(__ARMCC_VERSION)
|
||||||
int gettimeofday(struct timeval *tp, void *tzp) {
|
int gettimeofday(struct timeval *tp, void *tzp) {
|
||||||
/* TODO */
|
/* TODO */
|
||||||
tp->tv_sec = 0;
|
tp->tv_sec = 0;
|
||||||
@@ -11798,7 +11799,8 @@ int sl_fs_init(void) {
|
|||||||
#ifdef __TI_COMPILER_VERSION__
|
#ifdef __TI_COMPILER_VERSION__
|
||||||
#ifdef MG_FS_SLFS
|
#ifdef MG_FS_SLFS
|
||||||
#pragma diag_push
|
#pragma diag_push
|
||||||
#pragma diag_suppress 169 /* Nothing we can do about the prototype mismatch. */
|
#pragma diag_suppress 169 /* Nothing we can do about the prototype mismatch. \
|
||||||
|
*/
|
||||||
ret = (add_device("SL", _MSA, fs_slfs_open, fs_slfs_close, fs_slfs_read,
|
ret = (add_device("SL", _MSA, fs_slfs_open, fs_slfs_close, fs_slfs_read,
|
||||||
fs_slfs_write, fs_slfs_lseek, fs_slfs_unlink,
|
fs_slfs_write, fs_slfs_lseek, fs_slfs_unlink,
|
||||||
fs_slfs_rename) == 0);
|
fs_slfs_rename) == 0);
|
||||||
@@ -11914,7 +11916,8 @@ void mg_run_in_task(void (*cb)(struct mg_mgr *mgr, void *arg), void *cb_arg) {
|
|||||||
osi_MsgQWrite(&s_mg_q, &msg, OSI_NO_WAIT);
|
osi_MsgQWrite(&s_mg_q, &msg, OSI_NO_WAIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MG_NET_IF == MG_NET_IF_SIMPLELINK && !defined(MG_SIMPLELINK_NO_OSI) */
|
#endif /* MG_NET_IF == MG_NET_IF_SIMPLELINK && !defined(MG_SIMPLELINK_NO_OSI) \
|
||||||
|
*/
|
||||||
#ifdef MG_MODULE_LINES
|
#ifdef MG_MODULE_LINES
|
||||||
#line 1 "common/platforms/simplelink/sl_net_if.h"
|
#line 1 "common/platforms/simplelink/sl_net_if.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -13277,7 +13280,8 @@ uint32_t mg_lwip_get_poll_delay_ms(struct mg_mgr *mgr) {
|
|||||||
* All rights reserved
|
* All rights reserved
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if MG_NET_IF == MG_NET_IF_LWIP_LOW_LEVEL && MG_ENABLE_SSL && defined(KR_VERSION)
|
#if MG_NET_IF == MG_NET_IF_LWIP_LOW_LEVEL && MG_ENABLE_SSL && \
|
||||||
|
defined(KR_VERSION)
|
||||||
|
|
||||||
/* Amalgamated: #include "common/cs_dbg.h" */
|
/* Amalgamated: #include "common/cs_dbg.h" */
|
||||||
|
|
||||||
@@ -13436,7 +13440,8 @@ ssize_t kr_recv(int fd, void *buf, size_t len) {
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MG_NET_IF == MG_NET_IF_LWIP_LOW_LEVEL && MG_ENABLE_SSL && defined(KR_VERSION) */
|
#endif /* MG_NET_IF == MG_NET_IF_LWIP_LOW_LEVEL && MG_ENABLE_SSL && \
|
||||||
|
defined(KR_VERSION) */
|
||||||
#ifdef MG_MODULE_LINES
|
#ifdef MG_MODULE_LINES
|
||||||
#line 1 "common/platforms/wince/wince_libc.c"
|
#line 1 "common/platforms/wince/wince_libc.c"
|
||||||
#endif
|
#endif
|
||||||
@@ -13463,8 +13468,8 @@ int open(const char *filename, int oflag, int pmode) {
|
|||||||
* but exists in documentation as utility function
|
* but exists in documentation as utility function
|
||||||
* Shall we delete it at all or implement for WinCE as well?
|
* Shall we delete it at all or implement for WinCE as well?
|
||||||
*/
|
*/
|
||||||
DebugBreak();
|
DebugBreak();
|
||||||
return 0; /* for compiler */
|
return 0; /* for compiler */
|
||||||
}
|
}
|
||||||
|
|
||||||
int _wstati64(const wchar_t *path, cs_stat_t *st) {
|
int _wstati64(const wchar_t *path, cs_stat_t *st) {
|
||||||
@@ -13478,14 +13483,16 @@ int _wstati64(const wchar_t *path, cs_stat_t *st) {
|
|||||||
FILETIME ftime;
|
FILETIME ftime;
|
||||||
st->st_mode |= _S_IFREG;
|
st->st_mode |= _S_IFREG;
|
||||||
h = CreateFileW(path, GENERIC_READ, 0, NULL, OPEN_EXISTING,
|
h = CreateFileW(path, GENERIC_READ, 0, NULL, OPEN_EXISTING,
|
||||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if (h == INVALID_HANDLE_VALUE) {
|
if (h == INVALID_HANDLE_VALUE) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
st->st_size = GetFileSize(h, NULL);
|
st->st_size = GetFileSize(h, NULL);
|
||||||
GetFileTime(h, NULL, NULL, &ftime);
|
GetFileTime(h, NULL, NULL, &ftime);
|
||||||
st->st_mtime = (uint32_t)((((uint64_t)ftime.dwLowDateTime +
|
st->st_mtime = (uint32_t)((((uint64_t) ftime.dwLowDateTime +
|
||||||
((uint64_t)ftime.dwHighDateTime << 32)) / 10000000.0) - 11644473600);
|
((uint64_t) ftime.dwHighDateTime << 32)) /
|
||||||
|
10000000.0) -
|
||||||
|
11644473600);
|
||||||
CloseHandle(h);
|
CloseHandle(h);
|
||||||
} else {
|
} else {
|
||||||
st->st_mode |= _S_IFDIR;
|
st->st_mode |= _S_IFDIR;
|
||||||
@@ -13506,9 +13513,9 @@ static void mg_gmt_time_string(char *buf, size_t buf_len, time_t *t) {
|
|||||||
GetSystemTime(&systime);
|
GetSystemTime(&systime);
|
||||||
}
|
}
|
||||||
/* There is no PRIu16 in WinCE SDK */
|
/* There is no PRIu16 in WinCE SDK */
|
||||||
snprintf(buf, buf_len, "%d.%d.%d %d:%d:%d GMT", (int)systime.wYear,
|
snprintf(buf, buf_len, "%d.%d.%d %d:%d:%d GMT", (int) systime.wYear,
|
||||||
(int)systime.wMonth, (int)systime.wDay, (int)systime.wHour,
|
(int) systime.wMonth, (int) systime.wDay, (int) systime.wHour,
|
||||||
(int)systime.wMinute, (int)systime.wSecond);
|
(int) systime.wMinute, (int) systime.wSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+7
-8
@@ -1446,7 +1446,6 @@ char* inet_ntoa(struct in_addr in);
|
|||||||
|
|
||||||
#if MG_LWIP
|
#if MG_LWIP
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When compiling for nRF5x chips with arm-none-eabi-gcc, it has BYTE_ORDER
|
* When compiling for nRF5x chips with arm-none-eabi-gcc, it has BYTE_ORDER
|
||||||
* already defined, so in order to avoid warnings in lwip, we have to undefine
|
* already defined, so in order to avoid warnings in lwip, we have to undefine
|
||||||
@@ -1457,7 +1456,7 @@ char* inet_ntoa(struct in_addr in);
|
|||||||
* nRF5 SDK: 0.9.0
|
* nRF5 SDK: 0.9.0
|
||||||
*/
|
*/
|
||||||
#if CS_PLATFORM == CS_P_NRF51 || CS_PLATFORM == CS_P_NRF52
|
#if CS_PLATFORM == CS_P_NRF51 || CS_PLATFORM == CS_P_NRF52
|
||||||
# undef BYTE_ORDER
|
#undef BYTE_ORDER
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <lwip/opt.h>
|
#include <lwip/opt.h>
|
||||||
@@ -1472,14 +1471,14 @@ char* inet_ntoa(struct in_addr in);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LWIP_SOCKET
|
#if LWIP_SOCKET
|
||||||
# include <lwip/sockets.h>
|
#include <lwip/sockets.h>
|
||||||
#else
|
#else
|
||||||
/* We really need the definitions from sockets.h. */
|
/* We really need the definitions from sockets.h. */
|
||||||
# undef LWIP_SOCKET
|
#undef LWIP_SOCKET
|
||||||
# define LWIP_SOCKET 1
|
#define LWIP_SOCKET 1
|
||||||
# include <lwip/sockets.h>
|
#include <lwip/sockets.h>
|
||||||
# undef LWIP_SOCKET
|
#undef LWIP_SOCKET
|
||||||
# define LWIP_SOCKET 0
|
#define LWIP_SOCKET 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define INVALID_SOCKET (-1)
|
#define INVALID_SOCKET (-1)
|
||||||
|
|||||||
Reference in new issue
Block a user