瀏覽代碼

[Minor] Fix some compile issues

tags/2.6
Vsevolod Stakhov 4 年之前
父節點
當前提交
642a7f9a07

+ 2
- 5
contrib/google-ced/CMakeLists.txt 查看文件



option(BUILD_SHARED_LIBS "Build shared libraries" OFF) option(BUILD_SHARED_LIBS "Build shared libraries" OFF)


if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-narrowing")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-c++11-narrowing")
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-narrowing")


include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR})



+ 6
- 6
contrib/google-ced/compact_enc_det.cc 查看文件

normalized_tld.c_str()); normalized_tld.c_str());
if (n >= 0) { if (n >= 0) {
// TLD is four bytes, probability table is ~12 bytes // TLD is four bytes, probability table is ~12 bytes
int best_sub = ApplyCompressedProb(&kTLDHintProbs[n].key_prob[kMaxTldKey],
int best_sub = ApplyCompressedProb((const char *)&kTLDHintProbs[n].key_prob[kMaxTldKey],
kMaxTldVector, weight, destatep); kMaxTldVector, weight, destatep);
// Never boost ASCII7; do CP1252 instead // Never boost ASCII7; do CP1252 instead
if (best_sub == F_ASCII_7_bit) {best_sub = F_CP1252;} if (best_sub == F_ASCII_7_bit) {best_sub = F_CP1252;}
normalized_charset.c_str()); normalized_charset.c_str());
if (n >= 0) { if (n >= 0) {
// Charset is eight bytes, probability table is ~eight bytes // Charset is eight bytes, probability table is ~eight bytes
int best_sub = ApplyCompressedProb(&kCharsetHintProbs[n].key_prob[kMaxCharsetKey],
int best_sub = ApplyCompressedProb((const char *)&kCharsetHintProbs[n].key_prob[kMaxCharsetKey],
kMaxCharsetVector, weight, destatep); kMaxCharsetVector, weight, destatep);
// Never boost ASCII7; do CP1252 instead // Never boost ASCII7; do CP1252 instead
if (best_sub == F_ASCII_7_bit) {best_sub = F_CP1252;} if (best_sub == F_ASCII_7_bit) {best_sub = F_CP1252;}
normalized_lang.c_str()); normalized_lang.c_str());
if (n >= 0) { if (n >= 0) {
// Language is eight bytes, probability table is ~eight bytes // Language is eight bytes, probability table is ~eight bytes
int best_sub = ApplyCompressedProb(&kLangHintProbs[n].key_prob[kMaxLangKey],
int best_sub = ApplyCompressedProb((const char *)&kLangHintProbs[n].key_prob[kMaxLangKey],
kMaxLangVector, weight, destatep); kMaxLangVector, weight, destatep);
// Never boost ASCII7; do CP1252 instead // Never boost ASCII7; do CP1252 instead
if (best_sub == F_ASCII_7_bit) {best_sub = F_CP1252;} if (best_sub == F_ASCII_7_bit) {best_sub = F_CP1252;}


// Charset is eight bytes, probability table is eight bytes // Charset is eight bytes, probability table is eight bytes
int toprankenc = int toprankenc =
TopCompressedProb(&kLangHintProbs[n].key_prob[kMaxLangKey],
TopCompressedProb((const char *)&kLangHintProbs[n].key_prob[kMaxLangKey],
kMaxLangVector); kMaxLangVector);
return kMapToEncoding[toprankenc]; return kMapToEncoding[toprankenc];
} }


// TLD is four bytes, probability table is 12 bytes // TLD is four bytes, probability table is 12 bytes
int toprankenc = int toprankenc =
TopCompressedProb(&kTLDHintProbs[n].key_prob[kMaxTldKey],
TopCompressedProb((const char *)&kTLDHintProbs[n].key_prob[kMaxTldKey],
kMaxTldVector); kMaxTldVector);
return kMapToEncoding[toprankenc]; return kMapToEncoding[toprankenc];
} }


// Charset is eight bytes, probability table is eight bytes // Charset is eight bytes, probability table is eight bytes
int toprankenc = int toprankenc =
TopCompressedProb(&kCharsetHintProbs[n].key_prob[kMaxCharsetKey],
TopCompressedProb((const char *)&kCharsetHintProbs[n].key_prob[kMaxCharsetKey],
kMaxCharsetVector); kMaxCharsetVector);
return kMapToEncoding[toprankenc]; return kMapToEncoding[toprankenc];
} }

+ 1
- 1
contrib/google-ced/compact_enc_det_generated_tables.h 查看文件



// Massaged TLD or charset, followed by packed encoding probs // Massaged TLD or charset, followed by packed encoding probs
typedef struct { typedef struct {
char key_prob[20];
unsigned char key_prob[20];
} HintEntry; } HintEntry;


static const HintEntry kLangHintProbs[] = { // MaxRange 192 static const HintEntry kLangHintProbs[] = { // MaxRange 192

+ 0
- 1
src/libmime/mime_encoding.c 查看文件

#include "contrib/fastutf8/fastutf8.h" #include "contrib/fastutf8/fastutf8.h"
#include "contrib/google-ced/ced_c.h" #include "contrib/google-ced/ced_c.h"
#include <unicode/ucnv.h> #include <unicode/ucnv.h>
#include <unicode/ucsdet.h>
#if U_ICU_VERSION_MAJOR_NUM >= 44 #if U_ICU_VERSION_MAJOR_NUM >= 44
#include <unicode/unorm2.h> #include <unicode/unorm2.h>
#endif #endif

Loading…
取消
儲存