summaryrefslogtreecommitdiffstats
path: root/src/H5Fprivate.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-03-11 22:03:27 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-03-11 22:03:27 (GMT)
commit6af9839f16b6dd96e1e961f527cbbce31f05b33f (patch)
tree86888c49e69cc330410db0fe8750a9643a05e9ac /src/H5Fprivate.h
parent810cda019d901ccabda3b3c91f324ba965f97fef (diff)
downloadhdf5-6af9839f16b6dd96e1e961f527cbbce31f05b33f.zip
hdf5-6af9839f16b6dd96e1e961f527cbbce31f05b33f.tar.gz
hdf5-6af9839f16b6dd96e1e961f527cbbce31f05b33f.tar.bz2
[svn-r12080] Purpose:
New feature Description: Add "variable-length" 32-bit encode/decode macros, matching the other 64-bit ones, for later use in the fractal heap code. Platforms tested: FreeBSD 4.11 (sleipnir) Too minor for full h5committest
Diffstat (limited to 'src/H5Fprivate.h')
-rw-r--r--src/H5Fprivate.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index ff6717f..4bb6380 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -75,6 +75,18 @@ typedef struct H5F_t H5F_t;
*(p) = (uint8_t)(((i) >> 24) & 0xff); (p)++; \
}
+/* Encode a 32-bit unsigned integer into a variable-sized buffer */
+/* (Assumes that the high bits of the integer are zero) */
+# define UINT32ENCODE_VAR(p, n, l) { \
+ uint32_t _n = (n); \
+ size_t _i; \
+ uint8_t *_p = (uint8_t*)(p); \
+ \
+ for(_i = 0; _i < l; _i++, _n >>= 8) \
+ *_p++ = (uint8_t)(_n & 0xff); \
+ (p) = (uint8_t*)(p) + l; \
+}
+
# define INT64ENCODE(p, n) { \
int64_t _n = (n); \
size_t _i; \
@@ -143,6 +155,21 @@ typedef struct H5F_t H5F_t;
(i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \
}
+/* Decode a variable-sized buffer into a 32-bit unsigned integer */
+/* (Assumes that the high bits of the integer will be zero) */
+/* (Note: this is exactly the same code as the 64-bit variable-length decoder
+ * and bugs/improvements should be make in both places - QAK)
+ */
+# define UINT32DECODE_VAR(p, n, l) { \
+ size_t _i; \
+ \
+ n = 0; \
+ (p) += l; \
+ for (_i = 0; _i < l; _i++) \
+ n = (n << 8) | *(--p); \
+ (p) += l; \
+}
+
# define INT64DECODE(p, n) { \
/* WE DON'T CHECK FOR OVERFLOW! */ \
size_t _i; \
@@ -165,6 +192,9 @@ typedef struct H5F_t H5F_t;
/* Decode a variable-sized buffer into a 64-bit unsigned integer */
/* (Assumes that the high bits of the integer will be zero) */
+/* (Note: this is exactly the same code as the 32-bit variable-length decoder
+ * and bugs/improvements should be make in both places - QAK)
+ */
# define UINT64DECODE_VAR(p, n, l) { \
size_t _i; \
\
fs_static'>core_zip_vfs_static Tcl is a high-level, general-purpose, interpreted, dynamic programming language. It was designed with the goal of being very simple but powerful.
summaryrefslogtreecommitdiffstats
path: root/win/tclWinPort.h
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclWinPort.h')