aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/language/detector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/language/detector.cpp')
-rw-r--r--src/modules/language/detector.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/modules/language/detector.cpp b/src/modules/language/detector.cpp
index bbdb67812..9e5694972 100644
--- a/src/modules/language/detector.cpp
+++ b/src/modules/language/detector.cpp
@@ -23,30 +23,31 @@
// DO NOT EDIT THIS FILE: Edit detector/build_detector.pl instead!
//
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
+#include <cctype>
#include "detector.h"
+namespace {
//
// CORE DEFS
//
-typedef struct _DetectorNGram
+struct DetectorNGram
{
const unsigned char * szNGram;
double dScore;
-} DetectorNGram;
+};
-typedef struct _DetectorDescriptor
+struct DetectorDescriptor
{
const char * szLanguage;
const char * szEncoding;
double single_char_data[256];
DetectorNGram * ngram_hash[256];
-} DetectorDescriptor;
+};
static DetectorNGram X[] = { { nullptr, 0 } };
@@ -18712,6 +18713,7 @@ static int utf8score(const unsigned char * p)
}
static const char * unknown_string = "?";
+} // namespace
void detect_language_and_encoding(const char * data, LanguageAndEncodingResult * retBuffer, int iFlags = 0)
{