]> granicus.if.org Git - onig/commitdiff
remove is_initialized() member from some encodings
authorK.Kosako <kosako@sofnec.co.jp>
Fri, 2 Mar 2018 08:38:13 +0000 (17:38 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Fri, 2 Mar 2018 08:38:13 +0000 (17:38 +0900)
src/ascii.c
src/utf16_be.c
src/utf16_le.c

index 750e78c4eb589da8fcac32c2143a4b09e4237f8c..cf4d4849e367555e17f37bc60373a56512c04dba 100644 (file)
 
 #include "regint.h"   /* for USE_CALLOUT */
 
-static int inited;
-
 static int
 init(void)
 {
-  if (inited == 0) {
 #ifdef USE_CALLOUT
 
     int id;
@@ -63,17 +60,18 @@ init(void)
 
 #endif /* USE_CALLOUT */
 
-    inited = 1;
-  }
-
   return ONIG_NORMAL;
 }
 
+#if 0
 static int
 is_initialized(void)
 {
-  return inited;
+  /* Don't use this function */
+  /* can't answer, because builtin callout entries removed in onig_end() */
+  return 0;
 }
+#endif
 
 static int
 ascii_is_code_ctype(OnigCodePoint code, unsigned int ctype)
@@ -102,6 +100,6 @@ OnigEncodingType OnigEncodingASCII = {
   onigenc_single_byte_left_adjust_char_head,
   onigenc_always_true_is_allowed_reverse_match,
   init,
-  is_initialized,
+  0, /* is_initialized */
   onigenc_always_true_is_valid_mbc_string
 };
index 865a4a09f359de7a2ed0ab22354e2892a10f70ce..c6820e40eb90ed3578c0764fe4965071cf24315b 100644 (file)
 #include "regint.h"  /* for USE_CALLOUT */
 
 
-static int inited;
-
 static int
 init(void)
 {
-  if (inited == 0) {
 #ifdef USE_CALLOUT
 
     int id;
@@ -65,19 +62,9 @@ init(void)
 
 #endif /* USE_CALLOUT */
 
-    inited = 1;
-  }
-
   return ONIG_NORMAL;
 }
 
-static int
-is_initialized(void)
-{
-  return inited;
-}
-
-
 static const int EncLen_UTF16[] = {
   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -279,6 +266,6 @@ OnigEncodingType OnigEncodingUTF16_BE = {
   utf16be_left_adjust_char_head,
   onigenc_always_false_is_allowed_reverse_match,
   init,
-  is_initialized,
+  0, /* is_initialized */
   is_valid_mbc_string
 };
index 15c652819c4e561ba77832491797ef6468468977..d2cdd9eff3085a0c4ab1965bb981ddf70ee7bdbd 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
-
 #include "regint.h"  /* for USE_CALLOUT */
 
-
-static int inited;
-
 static int
 init(void)
 {
-  if (inited == 0) {
 #ifdef USE_CALLOUT
 
     int id;
@@ -65,19 +60,9 @@ init(void)
 
 #endif /* USE_CALLOUT */
 
-    inited = 1;
-  }
-
   return ONIG_NORMAL;
 }
 
-static int
-is_initialized(void)
-{
-  return inited;
-}
-
-
 static const int EncLen_UTF16[] = {
   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -289,6 +274,6 @@ OnigEncodingType OnigEncodingUTF16_LE = {
   utf16le_left_adjust_char_head,
   onigenc_always_false_is_allowed_reverse_match,
   init,
-  is_initialized,
+  0, /* is_initialized */
   is_valid_mbc_string
 };