Delete some obsolete base-private comments

This commit is contained in:
Nigel Tao committed 2018-06-10 08:11:38 +10:00
1 parent caa398441f
commit a177e798f4
9 files changed
+36 -108

No files matched your search

+4 -13
View File
@@ -14,10 +14,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
return ((wuffs_base__empty_struct){});
}
#define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x)
// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.
@@ -68,18 +64,9 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
#define WUFFS_BASE__UNLIKELY(expr) (expr)
#endif
// Uncomment this #include for printf-debugging.
// #include <stdio.h>
// The helpers below are functions, instead of macros, because their arguments
// can be an expression that we shouldn't evaluate more than once.
//
// They are in base-impl.h and hence copy/pasted into every generated C file,
// instead of being in some "base.c" file, since a design goal is that users of
// the generated C code can often just #include a single .c file, such as
// "gif.c", without having to additionally include or otherwise build and link
// a "base.c" file.
//
// They are static, so that linking multiple wuffs .o files won't complain about
// duplicate function definitions.
//
@@ -87,6 +74,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
// inline attribute to guide optimizations such as inlining, to avoid the
// -Wunused-function warning, and we like to compile with -Wall -Werror.
static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
return ((wuffs_base__empty_struct){});
}
// ---------------- Numeric Types
static inline uint16_t wuffs_base__load_u16be(uint8_t* p) {
+4 -4
View File
@@ -91,10 +91,10 @@ const basePublicH = "" +
""
const basePrivateH = "" +
"// Copyright 2017 The Wuffs Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nstatic inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {\n return ((wuffs_base__empty_struct){});\n}\n\n#define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x)\n\n// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.\n// It's not foolproof, given C doesn't automatically zero memory before use,\n// but it should catch 99.99% of cases.\n//\n// Its (non-zero) value is arbitrary, base" +
"d on md5sum(\"wuffs\").\n#define WUFFS_BASE__MAGIC ((uint32_t)0x3CCB6C71)\n\n// Denote intentional fallthroughs for -Wimplicit-fallthrough.\n//\n// The order matters here. Clang also defines \"__GNUC__\".\n#if defined(__clang__) && __cplusplus >= 201103L\n#define WUFFS_BASE__FALLTHROUGH [[clang::fallthrough]]\n#elif !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 7)\n#define WUFFS_BASE__FALLTHROUGH __attribute__((fallthrough))\n#else\n#define WUFFS_BASE__FALLTHROUGH\n#endif\n\n// Use switch cases for coroutine suspension points, similar to the technique\n// in https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html\n//\n// We use trivial macros instead of an explicit assignment and case statement\n// so that clang-format doesn't get confused by the unusual \"case\"s.\n#define WUFFS_BASE__COROUTINE_SUSPENSION_POINT_0 case 0:;\n#define WUFFS_BASE__COROUTINE_SUSPENSION_POINT(n) \\\n coro_susp_point = n; \\\n WUFFS_BASE__FALLTHROUGH; \\\n case n:;\n\n#define WUFFS_BASE__COROUTINE_" +
"SUSPENSION_POINT_MAYBE_SUSPEND(n) \\\n if (status < 0) { \\\n goto exit; \\\n } else if (status == 0) { \\\n goto ok; \\\n } \\\n coro_susp_point = n; \\\n goto suspend; \\\n case n:;\n\n// Clang also defines \"__GNUC__\".\n#if defined(__GNUC__)\n#define WUFFS_BASE__LIKELY(expr) (__builtin_expect(!!(expr), 1))\n#define WUFFS_BASE__UNLIKELY(expr) (__builtin_expect(!!(expr), 0))\n#else\n#define WUFFS_BASE__LIKELY(expr) (expr)\n#define WUFFS_BASE__UNLIKELY(expr) (expr)\n#endif\n\n// Uncomment this #include for printf-debugging.\n// #include <stdio.h>\n\n// The helpers below are functions, instead of macros, because their arguments\n// can be an expression that we shouldn't evaluate more than once.\n//\n// They a" +
"re in base-impl.h and hence copy/pasted into every generated C file,\n// instead of being in some \"base.c\" file, since a design goal is that users of\n// the generated C code can often just #include a single .c file, such as\n// \"gif.c\", without having to additionally include or otherwise build and link\n// a \"base.c\" file.\n//\n// They are static, so that linking multiple wuffs .o files won't complain about\n// duplicate function definitions.\n//\n// They are explicitly marked inline, even if modern compilers don't use the\n// inline attribute to guide optimizations such as inlining, to avoid the\n// -Wunused-function warning, and we like to compile with -Wall -Werror.\n\n" +
"// Copyright 2017 The Wuffs Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x)\n\n// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.\n// It's not foolproof, given C doesn't automatically zero memory before use,\n// but it should catch 99.99% of cases.\n//\n// Its (non-zero) value is arbitrary, based on md5sum(\"wuffs\").\n#define WUFFS_BASE__MAGIC ((uint32_t)0x3CCB6C71)\n\n// Denote intentional fallthroughs for -Wimplic" +
"it-fallthrough.\n//\n// The order matters here. Clang also defines \"__GNUC__\".\n#if defined(__clang__) && __cplusplus >= 201103L\n#define WUFFS_BASE__FALLTHROUGH [[clang::fallthrough]]\n#elif !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 7)\n#define WUFFS_BASE__FALLTHROUGH __attribute__((fallthrough))\n#else\n#define WUFFS_BASE__FALLTHROUGH\n#endif\n\n// Use switch cases for coroutine suspension points, similar to the technique\n// in https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html\n//\n// We use trivial macros instead of an explicit assignment and case statement\n// so that clang-format doesn't get confused by the unusual \"case\"s.\n#define WUFFS_BASE__COROUTINE_SUSPENSION_POINT_0 case 0:;\n#define WUFFS_BASE__COROUTINE_SUSPENSION_POINT(n) \\\n coro_susp_point = n; \\\n WUFFS_BASE__FALLTHROUGH; \\\n case n:;\n\n#define WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(n) \\\n if (status < 0) { \\\n goto exit; " +
" \\\n } else if (status == 0) { \\\n goto ok; \\\n } \\\n coro_susp_point = n; \\\n goto suspend; \\\n case n:;\n\n// Clang also defines \"__GNUC__\".\n#if defined(__GNUC__)\n#define WUFFS_BASE__LIKELY(expr) (__builtin_expect(!!(expr), 1))\n#define WUFFS_BASE__UNLIKELY(expr) (__builtin_expect(!!(expr), 0))\n#else\n#define WUFFS_BASE__LIKELY(expr) (expr)\n#define WUFFS_BASE__UNLIKELY(expr) (expr)\n#endif\n\n// The helpers below are functions, instead of macros, because their arguments\n// can be an expression that we shouldn't evaluate more than once.\n//\n// They are static, so that linking multiple wuffs .o files won't complain about\n// duplicate function definitions.\n//\n// They are explicitly marked inline, even if modern compilers don't use the\n// i" +
"nline attribute to guide optimizations such as inlining, to avoid the\n// -Wunused-function warning, and we like to compile with -Wall -Werror.\n\nstatic inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {\n return ((wuffs_base__empty_struct){});\n}\n\n" +
"" +
"// ---------------- Numeric Types\n\nstatic inline uint16_t wuffs_base__load_u16be(uint8_t* p) {\n return ((uint16_t)(p[0]) << 8) | ((uint16_t)(p[1]) << 0);\n}\n\nstatic inline uint16_t wuffs_base__load_u16le(uint8_t* p) {\n return ((uint16_t)(p[0]) << 0) | ((uint16_t)(p[1]) << 8);\n}\n\nstatic inline uint32_t wuffs_base__load_u24be(uint8_t* p) {\n return ((uint32_t)(p[0]) << 16) | ((uint32_t)(p[1]) << 8) |\n ((uint32_t)(p[2]) << 0);\n}\n\nstatic inline uint32_t wuffs_base__load_u24le(uint8_t* p) {\n return ((uint32_t)(p[0]) << 0) | ((uint32_t)(p[1]) << 8) |\n ((uint32_t)(p[2]) << 16);\n}\n\nstatic inline uint32_t wuffs_base__load_u32be(uint8_t* p) {\n return ((uint32_t)(p[0]) << 24) | ((uint32_t)(p[1]) << 16) |\n ((uint32_t)(p[2]) << 8) | ((uint32_t)(p[3]) << 0);\n}\n\nstatic inline uint32_t wuffs_base__load_u32le(uint8_t* p) {\n return ((uint32_t)(p[0]) << 0) | ((uint32_t)(p[1]) << 8) |\n ((uint32_t)(p[2]) << 16) | ((uint32_t)(p[3]) << 24);\n}\n\nstatic inline uint64_t wuffs_base__load_u40be(uint8_t" +
"* p) {\n return ((uint64_t)(p[0]) << 32) | ((uint64_t)(p[1]) << 24) |\n ((uint64_t)(p[2]) << 16) | ((uint64_t)(p[3]) << 8) |\n ((uint64_t)(p[4]) << 0);\n}\n\nstatic inline uint64_t wuffs_base__load_u40le(uint8_t* p) {\n return ((uint64_t)(p[0]) << 0) | ((uint64_t)(p[1]) << 8) |\n ((uint64_t)(p[2]) << 16) | ((uint64_t)(p[3]) << 24) |\n ((uint64_t)(p[4]) << 32);\n}\n\nstatic inline uint64_t wuffs_base__load_u48be(uint8_t* p) {\n return ((uint64_t)(p[0]) << 40) | ((uint64_t)(p[1]) << 32) |\n ((uint64_t)(p[2]) << 24) | ((uint64_t)(p[3]) << 16) |\n ((uint64_t)(p[4]) << 8) | ((uint64_t)(p[5]) << 0);\n}\n\nstatic inline uint64_t wuffs_base__load_u48le(uint8_t* p) {\n return ((uint64_t)(p[0]) << 0) | ((uint64_t)(p[1]) << 8) |\n ((uint64_t)(p[2]) << 16) | ((uint64_t)(p[3]) << 24) |\n ((uint64_t)(p[4]) << 32) | ((uint64_t)(p[5]) << 40);\n}\n\nstatic inline uint64_t wuffs_base__load_u56be(uint8_t* p) {\n return ((uint64_t)(p[0]) << 48) | ((uint64_t)(p[1]) << 40) |\n ((u" +
+4 -13
View File
@@ -1322,10 +1322,6 @@ uint32_t wuffs_adler32__hasher__update(wuffs_adler32__hasher* self,
// See the License for the specific language governing permissions and
// limitations under the License.
static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
return ((wuffs_base__empty_struct){});
}
#define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x)
// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.
@@ -1376,18 +1372,9 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
#define WUFFS_BASE__UNLIKELY(expr) (expr)
#endif
// Uncomment this #include for printf-debugging.
// #include <stdio.h>
// The helpers below are functions, instead of macros, because their arguments
// can be an expression that we shouldn't evaluate more than once.
//
// They are in base-impl.h and hence copy/pasted into every generated C file,
// instead of being in some "base.c" file, since a design goal is that users of
// the generated C code can often just #include a single .c file, such as
// "gif.c", without having to additionally include or otherwise build and link
// a "base.c" file.
//
// They are static, so that linking multiple wuffs .o files won't complain about
// duplicate function definitions.
//
@@ -1395,6 +1382,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
// inline attribute to guide optimizations such as inlining, to avoid the
// -Wunused-function warning, and we like to compile with -Wall -Werror.
static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
return ((wuffs_base__empty_struct){});
}
// ---------------- Numeric Types
static inline uint16_t wuffs_base__load_u16be(uint8_t* p) {
+4 -13
View File
@@ -1321,10 +1321,6 @@ uint32_t wuffs_crc32__ieee_hasher__update(wuffs_crc32__ieee_hasher* self,
// See the License for the specific language governing permissions and
// limitations under the License.
static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
return ((wuffs_base__empty_struct){});
}
#define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x)
// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.
@@ -1375,18 +1371,9 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
#define WUFFS_BASE__UNLIKELY(expr) (expr)
#endif
// Uncomment this #include for printf-debugging.
// #include <stdio.h>
// The helpers below are functions, instead of macros, because their arguments
// can be an expression that we shouldn't evaluate more than once.
//
// They are in base-impl.h and hence copy/pasted into every generated C file,
// instead of being in some "base.c" file, since a design goal is that users of
// the generated C code can often just #include a single .c file, such as
// "gif.c", without having to additionally include or otherwise build and link
// a "base.c" file.
//
// They are static, so that linking multiple wuffs .o files won't complain about
// duplicate function definitions.
//
@@ -1394,6 +1381,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
// inline attribute to guide optimizations such as inlining, to avoid the
// -Wunused-function warning, and we like to compile with -Wall -Werror.
static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
return ((wuffs_base__empty_struct){});
}
// ---------------- Numeric Types
static inline uint16_t wuffs_base__load_u16be(uint8_t* p) {
+4 -13
View File
@@ -1412,10 +1412,6 @@ wuffs_deflate__status wuffs_deflate__decoder__decode(
// See the License for the specific language governing permissions and
// limitations under the License.
static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
return ((wuffs_base__empty_struct){});
}
#define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x)
// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.
@@ -1466,18 +1462,9 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
#define WUFFS_BASE__UNLIKELY(expr) (expr)
#endif
// Uncomment this #include for printf-debugging.
// #include <stdio.h>
// The helpers below are functions, instead of macros, because their arguments
// can be an expression that we shouldn't evaluate more than once.
//
// They are in base-impl.h and hence copy/pasted into every generated C file,
// instead of being in some "base.c" file, since a design goal is that users of
// the generated C code can often just #include a single .c file, such as
// "gif.c", without having to additionally include or otherwise build and link
// a "base.c" file.
//
// They are static, so that linking multiple wuffs .o files won't complain about
// duplicate function definitions.
//
@@ -1485,6 +1472,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
// inline attribute to guide optimizations such as inlining, to avoid the
// -Wunused-function warning, and we like to compile with -Wall -Werror.
static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
return ((wuffs_base__empty_struct){});
}
// ---------------- Numeric Types
static inline uint16_t wuffs_base__load_u16be(uint8_t* p) {
+4 -13
View File
@@ -1551,10 +1551,6 @@ wuffs_gif__status wuffs_gif__decoder__decode_up_to_id_part1(
// See the License for the specific language governing permissions and
// limitations under the License.
static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
return ((wuffs_base__empty_struct){});
}
#define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x)
// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.
@@ -1605,18 +1601,9 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
#define WUFFS_BASE__UNLIKELY(expr) (expr)
#endif
// Uncomment this #include for printf-debugging.
// #include <stdio.h>
// The helpers below are functions, instead of macros, because their arguments
// can be an expression that we shouldn't evaluate more than once.
//
// They are in base-impl.h and hence copy/pasted into every generated C file,
// instead of being in some "base.c" file, since a design goal is that users of
// the generated C code can often just #include a single .c file, such as
// "gif.c", without having to additionally include or otherwise build and link
// a "base.c" file.
//
// They are static, so that linking multiple wuffs .o files won't complain about
// duplicate function definitions.
//
@@ -1624,6 +1611,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
// inline attribute to guide optimizations such as inlining, to avoid the
// -Wunused-function warning, and we like to compile with -Wall -Werror.
static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
return ((wuffs_base__empty_struct){});
}
// ---------------- Numeric Types
static inline uint16_t wuffs_base__load_u16be(uint8_t* p) {
+4 -13
View File
@@ -1624,10 +1624,6 @@ wuffs_gzip__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
// See the License for the specific language governing permissions and
// limitations under the License.
static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
return ((wuffs_base__empty_struct){});
}
#define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x)
// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.
@@ -1678,18 +1674,9 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
#define WUFFS_BASE__UNLIKELY(expr) (expr)
#endif
// Uncomment this #include for printf-debugging.
// #include <stdio.h>
// The helpers below are functions, instead of macros, because their arguments
// can be an expression that we shouldn't evaluate more than once.
//
// They are in base-impl.h and hence copy/pasted into every generated C file,
// instead of being in some "base.c" file, since a design goal is that users of
// the generated C code can often just #include a single .c file, such as
// "gif.c", without having to additionally include or otherwise build and link
// a "base.c" file.
//
// They are static, so that linking multiple wuffs .o files won't complain about
// duplicate function definitions.
//
@@ -1697,6 +1684,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
// inline attribute to guide optimizations such as inlining, to avoid the
// -Wunused-function warning, and we like to compile with -Wall -Werror.
static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
return ((wuffs_base__empty_struct){});
}
// ---------------- Numeric Types
static inline uint16_t wuffs_base__load_u16be(uint8_t* p) {
+4 -13
View File
@@ -1345,10 +1345,6 @@ wuffs_lzw__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
// See the License for the specific language governing permissions and
// limitations under the License.
static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
return ((wuffs_base__empty_struct){});
}
#define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x)
// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.
@@ -1399,18 +1395,9 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
#define WUFFS_BASE__UNLIKELY(expr) (expr)
#endif
// Uncomment this #include for printf-debugging.
// #include <stdio.h>
// The helpers below are functions, instead of macros, because their arguments
// can be an expression that we shouldn't evaluate more than once.
//
// They are in base-impl.h and hence copy/pasted into every generated C file,
// instead of being in some "base.c" file, since a design goal is that users of
// the generated C code can often just #include a single .c file, such as
// "gif.c", without having to additionally include or otherwise build and link
// a "base.c" file.
//
// They are static, so that linking multiple wuffs .o files won't complain about
// duplicate function definitions.
//
@@ -1418,6 +1405,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
// inline attribute to guide optimizations such as inlining, to avoid the
// -Wunused-function warning, and we like to compile with -Wall -Werror.
static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
return ((wuffs_base__empty_struct){});
}
// ---------------- Numeric Types
static inline uint16_t wuffs_base__load_u16be(uint8_t* p) {
+4 -13
View File
@@ -1623,10 +1623,6 @@ wuffs_zlib__status wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self,
// See the License for the specific language governing permissions and
// limitations under the License.
static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
return ((wuffs_base__empty_struct){});
}
#define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x)
// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.
@@ -1677,18 +1673,9 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
#define WUFFS_BASE__UNLIKELY(expr) (expr)
#endif
// Uncomment this #include for printf-debugging.
// #include <stdio.h>
// The helpers below are functions, instead of macros, because their arguments
// can be an expression that we shouldn't evaluate more than once.
//
// They are in base-impl.h and hence copy/pasted into every generated C file,
// instead of being in some "base.c" file, since a design goal is that users of
// the generated C code can often just #include a single .c file, such as
// "gif.c", without having to additionally include or otherwise build and link
// a "base.c" file.
//
// They are static, so that linking multiple wuffs .o files won't complain about
// duplicate function definitions.
//
@@ -1696,6 +1683,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
// inline attribute to guide optimizations such as inlining, to avoid the
// -Wunused-function warning, and we like to compile with -Wall -Werror.
static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {
return ((wuffs_base__empty_struct){});
}
// ---------------- Numeric Types
static inline uint16_t wuffs_base__load_u16be(uint8_t* p) {