unistr: moved some UCS2 macros into util_unistr
authorAndrew Tridgell <tridge@samba.org>
Thu, 24 Mar 2011 04:39:27 +0000 (15:39 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 25 Mar 2011 03:37:06 +0000 (04:37 +0100)
we need to move towards eliminating smb_ucs2_t. This moves a couple of
the related macros into the only file they are used in

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

lib/util/charset/charset.h
source3/lib/util_unistr.c

index 494a4ebc1a5599fcb71a25e5d8d76b62ca5fc73a..141fbea7be4edac706b5ba7bfc7b1196383d9ad4 100644 (file)
@@ -48,15 +48,6 @@ typedef uint16_t smb_ucs2_t;
 /* turn a 7 bit character into a ucs2 character */
 #define UCS2_CHAR(c) ((c) << UCS2_SHIFT)
 
-/* return an ascii version of a ucs2 character */
-#define UCS2_TO_CHAR(c) (((c) >> UCS2_SHIFT) & 0xff)
-
-/* Copy into a smb_ucs2_t from a possibly unaligned buffer. Return the copied smb_ucs2_t */
-#define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((unsigned char *)(src))[0],\
-                               ((unsigned char *)(dest))[1] = ((unsigned char *)(src))[1], (dest))
-
-
-
 /*
  *   for each charset we have a function that pulls from that charset to
  *     a ucs2 buffer, and a function that pushes to a ucs2 buffer
index 14b5a8706b8d0a42ffd6bb5b8fa8daffa583eea7..7beb65c863afc7476ab2b665293a2a38c8f1f89a 100644 (file)
 static uint8 *valid_table;
 static bool initialized;
 
+/* Copy into a smb_ucs2_t from a possibly unaligned buffer. Return the copied smb_ucs2_t */
+#define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((unsigned char *)(src))[0],\
+                               ((unsigned char *)(dest))[1] = ((unsigned char *)(src))[1], (dest))
+
+
+/* return an ascii version of a ucs2 character */
+#define UCS2_TO_CHAR(c) (((c) >> UCS2_SHIFT) & 0xff)
+
+
 /**
  * Destroy global objects allocated by load_case_tables()
  **/