seanmdick / cld2

Automatically exported from code.google.com/p/cld2
0 stars 0 forks source link

utf8statetable.cc contains a bunch of unused functions #38

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile cld2 with clang's -Wunused-function

What is the expected output? What do you see instead?

Expected: No warnings. Instead, warnings.

This patch fixes it:

diff --git a/internal/utf8statetable.cc b/internal/utf8statetable.cc
index aa9a98e..bd1e161 100644
--- a/internal/utf8statetable.cc
+++ b/internal/utf8statetable.cc
@@ -173,34 +173,6 @@ static inline bool InStateZero_2(const UTF8ReplaceObj_2* 
st,
   return (static_cast<uint32>(Tbl - Tbl0) < st->state0_size);
 }

-// UTF8PropObj, UTF8ScanObj, UTF8ReplaceObj are all typedefs of
-// UTF8MachineObj.
-
-static bool IsPropObj(const UTF8StateMachineObj& obj) {
-  return obj.fast_state == NULL
-      && obj.max_expand == 0;
-}
-
-static bool IsPropObj_2(const UTF8StateMachineObj_2& obj) {
-  return obj.fast_state == NULL
-      && obj.max_expand == 0;
-}
-
-static bool IsScanObj(const UTF8StateMachineObj& obj) {
-  return obj.fast_state != NULL
-      && obj.max_expand == 0;
-}
-
-static bool IsReplaceObj(const UTF8StateMachineObj& obj) {
-  // Normally, obj.fast_state != NULL, but the handwritten tables
-  // in utf8statetable_unittest don't handle fast_states.
-  return obj.max_expand > 0;
-}
-
-static bool IsReplaceObj_2(const UTF8StateMachineObj_2& obj) {
-  return obj.max_expand > 0;
-}
-
 // Look up property of one UTF-8 character and advance over it
 // Return 0 if input length is zero
 // Return 0 and advance one byte if input is ill-formed

Original issue reported on code.google.com by thakis@chromium.org on 26 Jul 2015 at 3:27

GoogleCodeExporter commented 9 years ago

Original comment by thakis@chromium.org on 26 Jul 2015 at 3:28

GoogleCodeExporter commented 9 years ago
Jason, can you take a look at this?

Original comment by andrewha...@google.com on 27 Jul 2015 at 10:29