From cc9ba072d83f480964d26372fbd84bbd67a17a8f Mon Sep 17 00:00:00 2001 From: stefanocasazza Date: Fri, 22 Jun 2018 14:17:50 +0200 Subject: [PATCH] sync --- include/ulib/base/macro.h | 8 +- include/ulib/internal/chttp.h | 6 +- include/ulib/orm/driver/orm_driver_mysql.h | 12 ++- include/ulib/orm/driver/orm_driver_pgsql.h | 12 ++- include/ulib/orm/driver/orm_driver_sqlite.h | 14 ++- include/ulib/orm/orm.h | 8 +- include/ulib/orm/orm_driver.h | 44 ++++++--- src/ulib/base/base.c | 18 ++-- src/ulib/base/utility.c | 92 +++++++++---------- src/ulib/json/value.cpp | 48 +++++----- src/ulib/net/server/plugin/mod_fcgi.cpp | 2 +- .../net/server/plugin/usp/jsonrequest.usp | 4 +- src/ulib/net/server/plugin/usp/update.cpp | 90 ------------------ src/ulib/net/server/plugin/usp/update.usp | 16 ---- .../net/server/plugin/usp/usp_translator.cpp | 2 +- src/ulib/orm/driver/orm_driver_mysql.cpp | 5 +- src/ulib/orm/driver/orm_driver_pgsql.cpp | 2 +- src/ulib/orm/driver/orm_driver_sqlite.cpp | 13 ++- src/ulib/orm/orm.cpp | 20 +++- src/ulib/orm/orm_driver.cpp | 10 +- src/ulib/utility/uhttp.cpp | 6 +- src/ulib/utility/websocket.cpp | 10 +- tests/examples/TSA/tsaserial | 2 +- .../FrameworkBenchmarks/ULib/src/update.usp | 16 ---- 24 files changed, 206 insertions(+), 254 deletions(-) delete mode 100644 src/ulib/net/server/plugin/usp/update.cpp diff --git a/include/ulib/base/macro.h b/include/ulib/base/macro.h index 927c9bb1..a7e7a19c 100644 --- a/include/ulib/base/macro.h +++ b/include/ulib/base/macro.h @@ -488,10 +488,10 @@ static inline void u_put_unalignedp64( void* p, uint64_t val) { s #define U_NUMBER_SUFFIX(num,suffix) \ switch (suffix) { \ - case 'G': num <<= 10; /* FALLTHRU */ \ - case 'M': num <<= 10; /* FALLTHRU */ \ - case 'K': /* FALLTHRU */ \ - case 'k': num <<= 10; /* FALLTHRU */ } + case 'G': num <<= 10; /* FALL THRU */ \ + case 'M': num <<= 10; /* FALL THRU */ \ + case 'K': /* FALL THRU */ \ + case 'k': num <<= 10; /* FALL THRU */ } #endif /* Optimization if it is enough a resolution of one second */ diff --git a/include/ulib/internal/chttp.h b/include/ulib/internal/chttp.h index dc52574e..06eb0da0 100644 --- a/include/ulib/internal/chttp.h +++ b/include/ulib/internal/chttp.h @@ -242,10 +242,10 @@ extern U_EXPORT uclientimage_info u_clientimage_info; #define U_http_content_type_len u_clientimage_info.http_info.flag[10] #define U_http_accept_language_len u_clientimage_info.http_info.flag[11] #define U_http_flag u_clientimage_info.http_info.flag[12] +#define U_http_usp_flag u_clientimage_info.http_info.flag[13] -#define U_http_len_user1 u_clientimage_info.http_info.flag[13] -#define U_http_len_user2 u_clientimage_info.http_info.flag[14] -#define U_http_len_user3 u_clientimage_info.http_info.flag[15] +#define U_http_len_user1 u_clientimage_info.http_info.flag[14] +#define U_http_len_user2 u_clientimage_info.http_info.flag[15] enum HttpRequestType { HTTP_IS_KEEP_ALIVE = 0x01, diff --git a/include/ulib/orm/driver/orm_driver_mysql.h b/include/ulib/orm/driver/orm_driver_mysql.h index f5223c77..3e653755 100644 --- a/include/ulib/orm/driver/orm_driver_mysql.h +++ b/include/ulib/orm/driver/orm_driver_mysql.h @@ -151,6 +151,13 @@ public: is_unsigned = false; } + explicit UMySqlStatementBindParam(UString& s) : USqlStatementBindParam(s) + { + U_TRACE_CTOR(0, UMySqlStatementBindParam, "%V", s.rep) + + type = U_UTF_VALUE; + } + explicit UMySqlStatementBindParam(const char* s, int n, bool bstatic) : USqlStatementBindParam(s, n, bstatic) { U_TRACE_CTOR(0, UMySqlStatementBindParam, "%.*S,%u,%b", n, s, n, bstatic) @@ -406,7 +413,10 @@ public: virtual USqlStatementBindParam* creatSqlStatementBindParam(unsigned long long* v) { UMySqlStatementBindParam* r; U_NEW(UMySqlStatementBindParam, r, UMySqlStatementBindParam(v)); return r; } - virtual USqlStatementBindParam* creatSqlStatementBindParam(USqlStatement* pstmt, const char* s, int n, bool bstatic, int rebind); + virtual USqlStatementBindParam* creatSqlStatementBindParam(UString& s) + { UMySqlStatementBindParam* r; U_NEW(UMySqlStatementBindParam, r, UMySqlStatementBindParam(s)); return r; } + + virtual USqlStatementBindParam* creatSqlStatementBindParam(USqlStatement* pstmt, const char* s, uint32_t n, bool bstatic, int rebind); // CREATE BIND RESULT diff --git a/include/ulib/orm/driver/orm_driver_pgsql.h b/include/ulib/orm/driver/orm_driver_pgsql.h index c3c3c69b..fe26e04d 100644 --- a/include/ulib/orm/driver/orm_driver_pgsql.h +++ b/include/ulib/orm/driver/orm_driver_pgsql.h @@ -190,6 +190,13 @@ public: length = sizeof(double); } + explicit UPgSqlStatementBindParam(UString& s) : USqlStatementBindParam(s) + { + U_TRACE_CTOR(0, UPgSqlStatementBindParam, "%V", s.rep) + + type = U_UTF_VALUE; + } + explicit UPgSqlStatementBindParam(const char* s, int n, bool bstatic) : USqlStatementBindParam(s, n, bstatic) { U_TRACE_CTOR(0, UPgSqlStatementBindParam, "%.*S,%u,%b", n, s, n, bstatic) @@ -471,7 +478,10 @@ public: virtual USqlStatementBindParam* creatSqlStatementBindParam(unsigned long long* v) { UPgSqlStatementBindParam* r; U_NEW(UPgSqlStatementBindParam, r, UPgSqlStatementBindParam(v)); return r; } - virtual USqlStatementBindParam* creatSqlStatementBindParam(USqlStatement* pstmt, const char* s, int n, bool bstatic, int rebind); + virtual USqlStatementBindParam* creatSqlStatementBindParam(UString& s) + { UPgSqlStatementBindParam* r; U_NEW(UPgSqlStatementBindParam, r, UPgSqlStatementBindParam(s)); return r; } + + virtual USqlStatementBindParam* creatSqlStatementBindParam(USqlStatement* pstmt, const char* s, uint32_t n, bool bstatic, int rebind); // CREATE BIND RESULT diff --git a/include/ulib/orm/driver/orm_driver_sqlite.h b/include/ulib/orm/driver/orm_driver_sqlite.h index e650f14d..d96885a6 100644 --- a/include/ulib/orm/driver/orm_driver_sqlite.h +++ b/include/ulib/orm/driver/orm_driver_sqlite.h @@ -132,7 +132,14 @@ public: type = U_REAL_VALUE; } - explicit USqliteStatementBindParam(const char* s, int n, bool bstatic) : USqlStatementBindParam(s, n, bstatic) + explicit USqliteStatementBindParam(UString& s) : USqlStatementBindParam(s) + { + U_TRACE_CTOR(0, USqliteStatementBindParam, "%V", s.rep) + + type = U_UTF_VALUE; + } + + explicit USqliteStatementBindParam(const char* s, uint32_t n, bool bstatic) : USqlStatementBindParam(s, n, bstatic) { U_TRACE_CTOR(0, USqliteStatementBindParam, "%.*S,%u,%b", n, s, n, bstatic) @@ -398,7 +405,10 @@ public: virtual USqlStatementBindParam* creatSqlStatementBindParam(unsigned long long* v) { USqliteStatementBindParam* r; U_NEW(USqliteStatementBindParam, r, USqliteStatementBindParam(v)); return r; } - virtual USqlStatementBindParam* creatSqlStatementBindParam(USqlStatement* pstmt, const char* s, int n, bool bstatic, int rebind); + virtual USqlStatementBindParam* creatSqlStatementBindParam(UString& s) + { USqliteStatementBindParam* r; U_NEW(USqliteStatementBindParam, r, USqliteStatementBindParam(s)); return r; } + + virtual USqlStatementBindParam* creatSqlStatementBindParam(USqlStatement* pstmt, const char* s, uint32_t n, bool bstatic, int rebind); // CREATE BIND RESULT diff --git a/include/ulib/orm/orm.h b/include/ulib/orm/orm.h index c9fb16ac..d388a5d4 100644 --- a/include/ulib/orm/orm.h +++ b/include/ulib/orm/orm.h @@ -270,7 +270,6 @@ public: #endif void bindParam(long long& v); void bindParam(struct tm& v); - void bindParam(UStringRep& v); void bindParam(const char* s); void bindParam(long double& v); void bindParam(unsigned int& v); @@ -279,7 +278,10 @@ public: void bindParam(unsigned short& v); void bindParam(unsigned long long& v); void bindParam(const char* b, const char* e); - void bindParam(const char* s, int n, bool bstatic, int rebind = -1); + void bindParam(const char* s, uint32_t n, bool bstatic, int rebind = -1); + + void bindParam(UString& v); + void bindParam(UStringRep& v); template void bindParam(UOrmTypeHandler t) { @@ -855,7 +857,7 @@ public: { U_TRACE(0, "UOrmTypeHandler::bindParam(%p)", stmt) - stmt->bindParam(*((UString*)pval)->rep); + stmt->bindParam(*(UString*)pval); } void bindResult(UOrmStatement* stmt) diff --git a/include/ulib/orm/orm_driver.h b/include/ulib/orm/orm_driver.h index 4ee9d788..a7417c0d 100644 --- a/include/ulib/orm/orm_driver.h +++ b/include/ulib/orm/orm_driver.h @@ -51,13 +51,29 @@ public: is_unsigned = false; } - explicit USqlStatementBindParam(const char* s, int n, bool bstatic); + explicit USqlStatementBindParam(UString& s) + { + U_TRACE_CTOR(0, USqlStatementBindParam, "%V", s.rep) + + buffer = s.data(); + length = s.capacity(); + pstr = &s; + type = 0; + + is_unsigned = false; + } + + explicit USqlStatementBindParam(const char* s, uint32_t n, bool bstatic); virtual ~USqlStatementBindParam() { U_TRACE_DTOR(0, USqlStatementBindParam) - if (pstr) U_DELETE(pstr) + if (pstr && + type != U_UTF_VALUE) + { + U_DELETE(pstr) + } } // DEBUG @@ -323,12 +339,17 @@ public: U_INTERNAL_ASSERT_POINTER(pstmt) - USqlStatementBindParam* ptr = creatSqlStatementBindParam(); - - pstmt->bindParam(ptr); + pstmt->bindParam(creatSqlStatementBindParam()); } - void bindParam(USqlStatement* pstmt, const char* s, int n, bool bstatic, int rebind) + void bindParam(USqlStatement* pstmt, UString& s) + { + U_TRACE(0, "UOrmDriver::bindParam(%p,%V)", pstmt, s.rep) + + pstmt->bindParam(creatSqlStatementBindParam(s)); + } + + void bindParam(USqlStatement* pstmt, const char* s, uint32_t n, bool bstatic, int rebind) { U_TRACE(0, "UOrmDriver::bindParam(%p,%.*S,%u,%b,%d)", pstmt, n, s, n, bstatic, rebind) @@ -345,9 +366,7 @@ public: U_INTERNAL_ASSERT_POINTER(pstmt) - USqlStatementBindParam* ptr = creatSqlStatementBindParam(v); - - pstmt->bindParam(ptr); + pstmt->bindParam(creatSqlStatementBindParam(v)); } template void bindParam(USqlStatement* pstmt, T& v) @@ -356,9 +375,7 @@ public: U_INTERNAL_ASSERT_POINTER(pstmt) - USqlStatementBindParam* ptr = creatSqlStatementBindParam(&v); - - pstmt->bindParam(ptr); + pstmt->bindParam(creatSqlStatementBindParam(&v)); } template void bindResult(USqlStatement* pstmt, T* v) @@ -487,6 +504,7 @@ public: virtual USqlStatementBindParam* creatSqlStatementBindParam(short* v) { return U_NULLPTR; } virtual USqlStatementBindParam* creatSqlStatementBindParam(float* v) { return U_NULLPTR; } virtual USqlStatementBindParam* creatSqlStatementBindParam(double* v) { return U_NULLPTR; } + virtual USqlStatementBindParam* creatSqlStatementBindParam(UString& s) { return U_NULLPTR; } virtual USqlStatementBindParam* creatSqlStatementBindParam(long long* v) { return U_NULLPTR; } virtual USqlStatementBindParam* creatSqlStatementBindParam(long double* v) { return U_NULLPTR; } virtual USqlStatementBindParam* creatSqlStatementBindParam(unsigned int* v) { return U_NULLPTR; } @@ -495,7 +513,7 @@ public: virtual USqlStatementBindParam* creatSqlStatementBindParam(unsigned short* v) { return U_NULLPTR; } virtual USqlStatementBindParam* creatSqlStatementBindParam(unsigned long long* v) { return U_NULLPTR; } - virtual USqlStatementBindParam* creatSqlStatementBindParam(USqlStatement* pstmt, const char* s, int n, bool bstatic, int rebind); + virtual USqlStatementBindParam* creatSqlStatementBindParam(USqlStatement* pstmt, const char* s, uint32_t n, bool bstatic, int rebind); // CREATE BIND RESULT diff --git a/src/ulib/base/base.c b/src/ulib/base/base.c index c5abbd30..d097f994 100644 --- a/src/ulib/base/base.c +++ b/src/ulib/base/base.c @@ -195,15 +195,15 @@ static inline char* u_itoa(uint32_t u, char* restrict p, uint32_t d, uint32_t n) { switch (n) { - case 10: d = u / 100000000; p = out(d, p); /* FALLTHRU */ - case 9: u -= d * 100000000; /* FALLTHRU */ - case 8: d = u / 1000000; p = out(d, p); /* FALLTHRU */ - case 7: u -= d * 1000000; /* FALLTHRU */ - case 6: d = u / 10000; p = out(d, p); /* FALLTHRU */ - case 5: u -= d * 10000; /* FALLTHRU */ - case 4: d = u / 100; p = out(d, p); /* FALLTHRU */ - case 3: u -= d * 100; /* FALLTHRU */ - case 2: d = u / 1; p = out(d, p); /* FALLTHRU */ + case 10: d = u / 100000000; p = out(d, p); /* FALL THRU */ + case 9: u -= d * 100000000; /* FALL THRU */ + case 8: d = u / 1000000; p = out(d, p); /* FALL THRU */ + case 7: u -= d * 1000000; /* FALL THRU */ + case 6: d = u / 10000; p = out(d, p); /* FALL THRU */ + case 5: u -= d * 10000; /* FALL THRU */ + case 4: d = u / 100; p = out(d, p); /* FALL THRU */ + case 3: u -= d * 100; /* FALL THRU */ + case 2: d = u / 1; p = out(d, p); /* FALL THRU */ case 1: ; } diff --git a/src/ulib/base/utility.c b/src/ulib/base/utility.c index 1cbb545b..cfe23dc7 100644 --- a/src/ulib/base/utility.c +++ b/src/ulib/base/utility.c @@ -67,22 +67,22 @@ __pure unsigned long u_hex2int(const char* restrict s, uint32_t len) /* handle u #ifndef U_COVERITY_FALSE_POSITIVE /* Control flow issues (MISSING_BREAK) */ switch (len) { - case 16: val = (val << 4) | u__hexc2int(s[len-16]); /* FALLTHRU */ - case 15: val = (val << 4) | u__hexc2int(s[len-15]); /* FALLTHRU */ - case 14: val = (val << 4) | u__hexc2int(s[len-14]); /* FALLTHRU */ - case 13: val = (val << 4) | u__hexc2int(s[len-13]); /* FALLTHRU */ - case 12: val = (val << 4) | u__hexc2int(s[len-12]); /* FALLTHRU */ - case 11: val = (val << 4) | u__hexc2int(s[len-11]); /* FALLTHRU */ - case 10: val = (val << 4) | u__hexc2int(s[len-10]); /* FALLTHRU */ - case 9: val = (val << 4) | u__hexc2int(s[len- 9]); /* FALLTHRU */ - case 8: val = (val << 4) | u__hexc2int(s[len- 8]); /* FALLTHRU */ - case 7: val = (val << 4) | u__hexc2int(s[len- 7]); /* FALLTHRU */ - case 6: val = (val << 4) | u__hexc2int(s[len- 6]); /* FALLTHRU */ - case 5: val = (val << 4) | u__hexc2int(s[len- 5]); /* FALLTHRU */ - case 4: val = (val << 4) | u__hexc2int(s[len- 4]); /* FALLTHRU */ - case 3: val = (val << 4) | u__hexc2int(s[len- 3]); /* FALLTHRU */ - case 2: val = (val << 4) | u__hexc2int(s[len- 2]); /* FALLTHRU */ - case 1: val = (val << 4) | u__hexc2int(s[len- 1]); /* FALLTHRU */ + case 16: val = (val << 4) | u__hexc2int(s[len-16]); /* FALL THRU */ + case 15: val = (val << 4) | u__hexc2int(s[len-15]); /* FALL THRU */ + case 14: val = (val << 4) | u__hexc2int(s[len-14]); /* FALL THRU */ + case 13: val = (val << 4) | u__hexc2int(s[len-13]); /* FALL THRU */ + case 12: val = (val << 4) | u__hexc2int(s[len-12]); /* FALL THRU */ + case 11: val = (val << 4) | u__hexc2int(s[len-11]); /* FALL THRU */ + case 10: val = (val << 4) | u__hexc2int(s[len-10]); /* FALL THRU */ + case 9: val = (val << 4) | u__hexc2int(s[len- 9]); /* FALL THRU */ + case 8: val = (val << 4) | u__hexc2int(s[len- 8]); /* FALL THRU */ + case 7: val = (val << 4) | u__hexc2int(s[len- 7]); /* FALL THRU */ + case 6: val = (val << 4) | u__hexc2int(s[len- 6]); /* FALL THRU */ + case 5: val = (val << 4) | u__hexc2int(s[len- 5]); /* FALL THRU */ + case 4: val = (val << 4) | u__hexc2int(s[len- 4]); /* FALL THRU */ + case 3: val = (val << 4) | u__hexc2int(s[len- 3]); /* FALL THRU */ + case 2: val = (val << 4) | u__hexc2int(s[len- 2]); /* FALL THRU */ + case 1: val = (val << 4) | u__hexc2int(s[len- 1]); /* FALL THRU */ } #endif @@ -103,15 +103,15 @@ __pure unsigned long u__strtoul(const char* restrict s, uint32_t len) /* handle #ifndef U_COVERITY_FALSE_POSITIVE /* Control flow issues (MISSING_BREAK) */ switch (len) { - case 10: val += (s[len-10] - '0') * 1000000000UL; /* FALLTHRU */ - case 9: val += (s[len- 9] - '0') * 100000000UL; /* FALLTHRU */ - case 8: val += (s[len- 8] - '0') * 10000000UL; /* FALLTHRU */ - case 7: val += (s[len- 7] - '0') * 1000000UL; /* FALLTHRU */ - case 6: val += (s[len- 6] - '0') * 100000UL; /* FALLTHRU */ - case 5: val += (s[len- 5] - '0') * 10000UL; /* FALLTHRU */ - case 4: val += (s[len- 4] - '0') * 1000UL; /* FALLTHRU */ - case 3: val += (s[len- 3] - '0') * 100UL; /* FALLTHRU */ - case 2: val += (s[len- 2] - '0') * 10UL; /* FALLTHRU */ + case 10: val += (s[len-10] - '0') * 1000000000UL; /* FALL THRU */ + case 9: val += (s[len- 9] - '0') * 100000000UL; /* FALL THRU */ + case 8: val += (s[len- 8] - '0') * 10000000UL; /* FALL THRU */ + case 7: val += (s[len- 7] - '0') * 1000000UL; /* FALL THRU */ + case 6: val += (s[len- 6] - '0') * 100000UL; /* FALL THRU */ + case 5: val += (s[len- 5] - '0') * 10000UL; /* FALL THRU */ + case 4: val += (s[len- 4] - '0') * 1000UL; /* FALL THRU */ + case 3: val += (s[len- 3] - '0') * 100UL; /* FALL THRU */ + case 2: val += (s[len- 2] - '0') * 10UL; /* FALL THRU */ case 1: val += (s[len- 1] - '0'); } #endif @@ -133,26 +133,26 @@ __pure uint64_t u__strtoull(const char* restrict s, uint32_t len) #ifndef U_COVERITY_FALSE_POSITIVE /* Control flow issues (MISSING_BREAK) */ switch (len) { - case 20: val += (s[len-20] - '0') * 10000000000000000000ULL; /* FALLTHRU */ - case 19: val += (s[len-19] - '0') * 1000000000000000000ULL; /* FALLTHRU */ - case 18: val += (s[len-18] - '0') * 100000000000000000ULL; /* FALLTHRU */ - case 17: val += (s[len-17] - '0') * 10000000000000000ULL; /* FALLTHRU */ - case 16: val += (s[len-16] - '0') * 1000000000000000ULL; /* FALLTHRU */ - case 15: val += (s[len-15] - '0') * 100000000000000ULL; /* FALLTHRU */ - case 14: val += (s[len-14] - '0') * 10000000000000ULL; /* FALLTHRU */ - case 13: val += (s[len-13] - '0') * 1000000000000ULL; /* FALLTHRU */ - case 12: val += (s[len-12] - '0') * 100000000000ULL; /* FALLTHRU */ - case 11: val += (s[len-11] - '0') * 10000000000ULL; /* FALLTHRU */ - case 10: val += (s[len-10] - '0') * 1000000000ULL; /* FALLTHRU */ - case 9: val += (s[len- 9] - '0') * 100000000ULL; /* FALLTHRU */ - case 8: val += (s[len- 8] - '0') * 10000000ULL; /* FALLTHRU */ - case 7: val += (s[len- 7] - '0') * 1000000ULL; /* FALLTHRU */ - case 6: val += (s[len- 6] - '0') * 100000ULL; /* FALLTHRU */ - case 5: val += (s[len- 5] - '0') * 10000ULL; /* FALLTHRU */ - case 4: val += (s[len- 4] - '0') * 1000ULL; /* FALLTHRU */ - case 3: val += (s[len- 3] - '0') * 100ULL; /* FALLTHRU */ - case 2: val += (s[len- 2] - '0') * 10ULL; /* FALLTHRU */ - case 1: val += (s[len- 1] - '0'); /* FALLTHRU */ + case 20: val += (s[len-20] - '0') * 10000000000000000000ULL; /* FALL THRU */ + case 19: val += (s[len-19] - '0') * 1000000000000000000ULL; /* FALL THRU */ + case 18: val += (s[len-18] - '0') * 100000000000000000ULL; /* FALL THRU */ + case 17: val += (s[len-17] - '0') * 10000000000000000ULL; /* FALL THRU */ + case 16: val += (s[len-16] - '0') * 1000000000000000ULL; /* FALL THRU */ + case 15: val += (s[len-15] - '0') * 100000000000000ULL; /* FALL THRU */ + case 14: val += (s[len-14] - '0') * 10000000000000ULL; /* FALL THRU */ + case 13: val += (s[len-13] - '0') * 1000000000000ULL; /* FALL THRU */ + case 12: val += (s[len-12] - '0') * 100000000000ULL; /* FALL THRU */ + case 11: val += (s[len-11] - '0') * 10000000000ULL; /* FALL THRU */ + case 10: val += (s[len-10] - '0') * 1000000000ULL; /* FALL THRU */ + case 9: val += (s[len- 9] - '0') * 100000000ULL; /* FALL THRU */ + case 8: val += (s[len- 8] - '0') * 10000000ULL; /* FALL THRU */ + case 7: val += (s[len- 7] - '0') * 1000000ULL; /* FALL THRU */ + case 6: val += (s[len- 6] - '0') * 100000ULL; /* FALL THRU */ + case 5: val += (s[len- 5] - '0') * 10000ULL; /* FALL THRU */ + case 4: val += (s[len- 4] - '0') * 1000ULL; /* FALL THRU */ + case 3: val += (s[len- 3] - '0') * 100ULL; /* FALL THRU */ + case 2: val += (s[len- 2] - '0') * 10ULL; /* FALL THRU */ + case 1: val += (s[len- 1] - '0'); /* FALL THRU */ } #endif @@ -1941,7 +1941,7 @@ __pure bool u_dosmatch_ext(const char* restrict s, uint32_t n1, const char* rest } } - /* FALLTHRU */ + /* FALL THRU */ default: { diff --git a/src/ulib/json/value.cpp b/src/ulib/json/value.cpp index 1b877bdd..ef267b62 100644 --- a/src/ulib/json/value.cpp +++ b/src/ulib/json/value.cpp @@ -913,17 +913,17 @@ void UValue::fromFlatBufferToJSON(UFlatBuffer& fb) switch (type) { - case UFlatBufferValue::TYPE_VECTOR_INT4: setInt64( vec.AsTypedOrFixedVectorGet< int64_t>(i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALLTHRU */ - case UFlatBufferValue::TYPE_VECTOR_INT3: setInt64( vec.AsTypedOrFixedVectorGet< int64_t>(i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALLTHRU */ - case UFlatBufferValue::TYPE_VECTOR_INT2: setInt64( vec.AsTypedOrFixedVectorGet< int64_t>(i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALLTHRU */ + case UFlatBufferValue::TYPE_VECTOR_INT4: setInt64( vec.AsTypedOrFixedVectorGet< int64_t>(i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALL THRU */ + case UFlatBufferValue::TYPE_VECTOR_INT3: setInt64( vec.AsTypedOrFixedVectorGet< int64_t>(i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALL THRU */ + case UFlatBufferValue::TYPE_VECTOR_INT2: setInt64( vec.AsTypedOrFixedVectorGet< int64_t>(i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALL THRU */ case UFlatBufferValue::TYPE_VECTOR_INT: setInt64( vec.AsTypedOrFixedVectorGet< int64_t>(i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); break; - case UFlatBufferValue::TYPE_VECTOR_UINT4: setUInt64(vec.AsTypedOrFixedVectorGet(i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALLTHRU */ - case UFlatBufferValue::TYPE_VECTOR_UINT3: setUInt64(vec.AsTypedOrFixedVectorGet(i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALLTHRU */ - case UFlatBufferValue::TYPE_VECTOR_UINT2: setUInt64(vec.AsTypedOrFixedVectorGet(i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALLTHRU */ + case UFlatBufferValue::TYPE_VECTOR_UINT4: setUInt64(vec.AsTypedOrFixedVectorGet(i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALL THRU */ + case UFlatBufferValue::TYPE_VECTOR_UINT3: setUInt64(vec.AsTypedOrFixedVectorGet(i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALL THRU */ + case UFlatBufferValue::TYPE_VECTOR_UINT2: setUInt64(vec.AsTypedOrFixedVectorGet(i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALL THRU */ case UFlatBufferValue::TYPE_VECTOR_UINT: setUInt64(vec.AsTypedOrFixedVectorGet(i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); break; - case UFlatBufferValue::TYPE_VECTOR_FLOAT4: setDouble(vec.AsTypedOrFixedVectorGet( i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALLTHRU */ - case UFlatBufferValue::TYPE_VECTOR_FLOAT3: setDouble(vec.AsTypedOrFixedVectorGet( i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALLTHRU */ - case UFlatBufferValue::TYPE_VECTOR_FLOAT2: setDouble(vec.AsTypedOrFixedVectorGet( i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALLTHRU */ + case UFlatBufferValue::TYPE_VECTOR_FLOAT4: setDouble(vec.AsTypedOrFixedVectorGet( i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALL THRU */ + case UFlatBufferValue::TYPE_VECTOR_FLOAT3: setDouble(vec.AsTypedOrFixedVectorGet( i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALL THRU */ + case UFlatBufferValue::TYPE_VECTOR_FLOAT2: setDouble(vec.AsTypedOrFixedVectorGet( i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); /* FALL THRU */ case UFlatBufferValue::TYPE_VECTOR_FLOAT: setDouble(vec.AsTypedOrFixedVectorGet( i++)); sd[pos].tails = insertAfter(sd[pos].tails, o.ival); break; } @@ -1461,21 +1461,21 @@ case_number: # ifndef U_COVERITY_FALSE_POSITIVE // Control flow issues (MISSING_BREAK) switch (decimalDigit) { - case 15: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit-15] - '0'); /* FALLTHRU */ - case 14: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit-14] - '0'); /* FALLTHRU */ - case 13: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit-13] - '0'); /* FALLTHRU */ - case 12: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit-12] - '0'); /* FALLTHRU */ - case 11: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit-11] - '0'); /* FALLTHRU */ - case 10: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit-10] - '0'); /* FALLTHRU */ - case 9: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 9] - '0'); /* FALLTHRU */ - case 8: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 8] - '0'); /* FALLTHRU */ - case 7: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 7] - '0'); /* FALLTHRU */ - case 6: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 6] - '0'); /* FALLTHRU */ - case 5: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 5] - '0'); /* FALLTHRU */ - case 4: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 4] - '0'); /* FALLTHRU */ - case 3: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 3] - '0'); /* FALLTHRU */ - case 2: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 2] - '0'); /* FALLTHRU */ - case 1: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 1] - '0'); /* FALLTHRU */ + case 15: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit-15] - '0'); /* FALL THRU */ + case 14: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit-14] - '0'); /* FALL THRU */ + case 13: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit-13] - '0'); /* FALL THRU */ + case 12: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit-12] - '0'); /* FALL THRU */ + case 11: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit-11] - '0'); /* FALL THRU */ + case 10: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit-10] - '0'); /* FALL THRU */ + case 9: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 9] - '0'); /* FALL THRU */ + case 8: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 8] - '0'); /* FALL THRU */ + case 7: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 7] - '0'); /* FALL THRU */ + case 6: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 6] - '0'); /* FALL THRU */ + case 5: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 5] - '0'); /* FALL THRU */ + case 4: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 4] - '0'); /* FALL THRU */ + case 3: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 3] - '0'); /* FALL THRU */ + case 2: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 2] - '0'); /* FALL THRU */ + case 1: integerPart = (integerPart << 3) + (integerPart << 1) + (p[decimalDigit- 1] - '0'); /* FALL THRU */ } # endif diff --git a/src/ulib/net/server/plugin/mod_fcgi.cpp b/src/ulib/net/server/plugin/mod_fcgi.cpp index e04f52be..88c3b633 100644 --- a/src/ulib/net/server/plugin/mod_fcgi.cpp +++ b/src/ulib/net/server/plugin/mod_fcgi.cpp @@ -457,7 +457,7 @@ int UFCGIPlugIn::handlerRequest() } } - /* FALLTHRU */ + /* FALL THRU */ case FCGI_UNKNOWN_TYPE: case FCGI_GET_VALUES_RESULT: diff --git a/src/ulib/net/server/plugin/usp/jsonrequest.usp b/src/ulib/net/server/plugin/usp/jsonrequest.usp index 7f6a35ec..0a6d73a6 100644 --- a/src/ulib/net/server/plugin/usp/jsonrequest.usp +++ b/src/ulib/net/server/plugin/usp/jsonrequest.usp @@ -109,9 +109,7 @@ private: Content-Type: application/jsonrequest -->