Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: fpdfsdk/src/javascript/global.cpp

Issue 1721073004: Switch from _DEBUG to NDEBUG. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: ifndef Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/src/fxcrt/fx_basic_wstring.cpp ('k') | xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "fpdfsdk/src/javascript/global.h" 7 #include "fpdfsdk/src/javascript/global.h"
8 8
9 #include "core/include/fxcrt/fx_ext.h" 9 #include "core/include/fxcrt/fx_ext.h"
10 #include "fpdfsdk/include/javascript/IJavaScript.h" 10 #include "fpdfsdk/include/javascript/IJavaScript.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 CHash<'o', 'b', 'j', 'e', 'c', 't'>::value; 50 CHash<'o', 'b', 'j', 'e', 'c', 't'>::value;
51 const unsigned int JSCONST_nFXobjHash = CHash<'f', 'x', 'o', 'b', 'j'>::value; 51 const unsigned int JSCONST_nFXobjHash = CHash<'f', 'x', 'o', 'b', 'j'>::value;
52 const unsigned int JSCONST_nNullHash = CHash<'n', 'u', 'l', 'l'>::value; 52 const unsigned int JSCONST_nNullHash = CHash<'n', 'u', 'l', 'l'>::value;
53 const unsigned int JSCONST_nUndefHash = 53 const unsigned int JSCONST_nUndefHash =
54 CHash<'u', 'n', 'd', 'e', 'f', 'i', 'n', 'e', 'd'>::value; 54 CHash<'u', 'n', 'd', 'e', 'f', 'i', 'n', 'e', 'd'>::value;
55 55
56 static unsigned JS_CalcHash(const wchar_t* main) { 56 static unsigned JS_CalcHash(const wchar_t* main) {
57 return (unsigned)FX_HashCode_String_GetW(main, FXSYS_wcslen(main)); 57 return (unsigned)FX_HashCode_String_GetW(main, FXSYS_wcslen(main));
58 } 58 }
59 59
60 #ifdef _DEBUG 60 #ifndef NDEBUG
61 class HashVerify { 61 class HashVerify {
62 public: 62 public:
63 HashVerify(); 63 HashVerify();
64 } g_hashVerify; 64 } g_hashVerify;
65 65
66 HashVerify::HashVerify() { 66 HashVerify::HashVerify() {
67 ASSERT(JSCONST_nStringHash == JS_CalcHash(kFXJSValueNameString)); 67 ASSERT(JSCONST_nStringHash == JS_CalcHash(kFXJSValueNameString));
68 ASSERT(JSCONST_nNumberHash == JS_CalcHash(kFXJSValueNameNumber)); 68 ASSERT(JSCONST_nNumberHash == JS_CalcHash(kFXJSValueNameNumber));
69 ASSERT(JSCONST_nBoolHash == JS_CalcHash(kFXJSValueNameBoolean)); 69 ASSERT(JSCONST_nBoolHash == JS_CalcHash(kFXJSValueNameBoolean));
70 ASSERT(JSCONST_nDateHash == JS_CalcHash(kFXJSValueNameDate)); 70 ASSERT(JSCONST_nDateHash == JS_CalcHash(kFXJSValueNameDate));
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 return CJS_Value::VT_boolean; 510 return CJS_Value::VT_boolean;
511 if (nHash == JSCONST_nDateHash) 511 if (nHash == JSCONST_nDateHash)
512 return CJS_Value::VT_date; 512 return CJS_Value::VT_date;
513 if (nHash == JSCONST_nObjectHash) 513 if (nHash == JSCONST_nObjectHash)
514 return CJS_Value::VT_object; 514 return CJS_Value::VT_object;
515 if (nHash == JSCONST_nFXobjHash) 515 if (nHash == JSCONST_nFXobjHash)
516 return CJS_Value::VT_fxobject; 516 return CJS_Value::VT_fxobject;
517 517
518 return CJS_Value::VT_unknown; 518 return CJS_Value::VT_unknown;
519 } 519 }
OLDNEW
« no previous file with comments | « core/src/fxcrt/fx_basic_wstring.cpp ('k') | xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698