]> Kevux Git Server - fll/commitdiff
Cleanup: only use f_macro_ for defines that structurally mimic functions
authorKevin Day <thekevinday@gmail.com>
Thu, 29 Aug 2019 00:57:28 +0000 (19:57 -0500)
committerKevin Day <thekevinday@gmail.com>
Thu, 29 Aug 2019 00:57:28 +0000 (19:57 -0500)
level_0/f_utf/c/utf.c
level_0/f_utf/c/utf.h

index 10c61fadb32092904e7a4b38663abe50f9473622..44b655e65001d2d5e060923eb55beb26439cf3ed 100644 (file)
@@ -354,7 +354,7 @@ extern "C" {
 
 #ifndef _di_f_utf_is_bom_character_
   f_return_status f_utf_is_bom_character(const f_utf_character character) {
-    if (character == f_macro_utf_character_mask_bom) {
+    if (character == f_utf_character_mask_bom) {
       return f_true;
     }
 
index 29ec202c1a7d9930d0b3ca2eed5a56ad61bca24f..8c00682e6adb72056e3042bf2c2322750f9f7a45 100644 (file)
@@ -117,22 +117,22 @@ extern "C" {
 #ifndef _di_f_utf_character_
   typedef uint32_t f_utf_character;
 
-  #define f_macro_utf_character_mask_bom 0xefbbbf00 // 1110 1111, 1011 1011, 1011 1111, 0000 0000
-
-  #define f_macro_utf_character_mask_byte_1 0xff000000 // 1111 1111, 0000 0000, 0000 0000, 0000 0000
-  #define f_macro_utf_character_mask_byte_2 0xffff0000 // 1111 1111, 1111 1111, 0000 0000, 0000 0000
-  #define f_macro_utf_character_mask_byte_3 0xffffff00 // 1111 1111, 1111 1111, 1111 1111, 0000 0000
-  #define f_macro_utf_character_mask_byte_4 0xffffffff // 1111 1111, 1111 1111, 1111 1111, 1111 1111
-
-  #define f_macro_utf_character_mask_char_1 0xff000000 // 1111 1111, 0000 0000, 0000 0000, 0000 0000
-  #define f_macro_utf_character_mask_char_2 0x00ff0000 // 0000 0000, 1111 1111, 0000 0000, 0000 0000
-  #define f_macro_utf_character_mask_char_3 0x0000ff00 // 0000 0000, 0000 0000, 1111 1111, 0000 0000
-  #define f_macro_utf_character_mask_char_4 0x000000ff // 0000 0000, 0000 0000, 0000 0000, 1111 1111
-
-  #define f_macro_utf_character_to_char_1(character) ((f_macro_utf_character_mask_char_1 & character) >> 24) // grab first byte.
-  #define f_macro_utf_character_to_char_2(character) ((f_macro_utf_character_mask_char_2 & character) >> 16) // grab second byte.
-  #define f_macro_utf_character_to_char_3(character) ((f_macro_utf_character_mask_char_3 & character) >> 8) // grab third byte.
-  #define f_macro_utf_character_to_char_4(character) (f_macro_utf_character_mask_char_4 & character) // grab fourth byte.
+  #define f_utf_character_mask_bom 0xefbbbf00 // 1110 1111, 1011 1011, 1011 1111, 0000 0000
+
+  #define f_utf_character_mask_byte_1 0xff000000 // 1111 1111, 0000 0000, 0000 0000, 0000 0000
+  #define f_utf_character_mask_byte_2 0xffff0000 // 1111 1111, 1111 1111, 0000 0000, 0000 0000
+  #define f_utf_character_mask_byte_3 0xffffff00 // 1111 1111, 1111 1111, 1111 1111, 0000 0000
+  #define f_utf_character_mask_byte_4 0xffffffff // 1111 1111, 1111 1111, 1111 1111, 1111 1111
+
+  #define f_utf_character_mask_char_1 0xff000000 // 1111 1111, 0000 0000, 0000 0000, 0000 0000
+  #define f_utf_character_mask_char_2 0x00ff0000 // 0000 0000, 1111 1111, 0000 0000, 0000 0000
+  #define f_utf_character_mask_char_3 0x0000ff00 // 0000 0000, 0000 0000, 1111 1111, 0000 0000
+  #define f_utf_character_mask_char_4 0x000000ff // 0000 0000, 0000 0000, 0000 0000, 1111 1111
+
+  #define f_macro_utf_character_to_char_1(character) ((f_utf_character_mask_char_1 & character) >> 24) // grab first byte.
+  #define f_macro_utf_character_to_char_2(character) ((f_utf_character_mask_char_2 & character) >> 16) // grab second byte.
+  #define f_macro_utf_character_to_char_3(character) ((f_utf_character_mask_char_3 & character) >> 8) // grab third byte.
+  #define f_macro_utf_character_to_char_4(character) (f_utf_character_mask_char_4 & character) // grab fourth byte.
 
   #define f_macro_utf_character_from_char_1(character) (character << 24) // shift the first byte.
   #define f_macro_utf_character_from_char_2(character) (character << 16) // shift the second byte.