+#if NCURSES_EXT_NUMBERS
+static size_t
+convert_16bit(unsigned char *buf, NCURSES_INT2 *Numbers, size_t count)
+{
+ size_t i, j;
+ size_t size = SIZEOF_SHORT;
+ for (i = 0; i < count; i++) {
+ unsigned value = (unsigned) Numbers[i];
+ TRACE_NUM(i);
+ for (j = 0; j < size; ++j) {
+ *buf++ = value & 0xff;
+ value >>= 8;
+ }
+ }
+ return size;
+}
+
+static size_t
+convert_32bit(unsigned char *buf, NCURSES_INT2 *Numbers, size_t count)
+{
+ size_t i, j;
+ size_t size = SIZEOF_INT2;
+ for (i = 0; i < count; i++) {
+ unsigned value = (unsigned) Numbers[i];
+ TRACE_NUM(i);
+ for (j = 0; j < size; ++j) {
+ *buf++ = value & 0xff;
+ value >>= 8;
+ }
+ }
+ return size;
+}
+#endif
+