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

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

Issue 1299963002: Extern in .cpp files is a code smell. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 4 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
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 "../../include/javascript/IJavaScript.h" 7 #include "../../include/javascript/IJavaScript.h"
8 #include "../../include/javascript/JS_Context.h" 8 #include "../../include/javascript/JS_Context.h"
9 #include "../../include/javascript/JS_Define.h" 9 #include "../../include/javascript/JS_Define.h"
10 #include "../../include/javascript/JS_EventHandler.h" 10 #include "../../include/javascript/JS_EventHandler.h"
(...skipping 20 matching lines...) Expand all
31 template <unsigned ACC, wchar_t N> 31 template <unsigned ACC, wchar_t N>
32 struct CHash<ACC, N> { 32 struct CHash<ACC, N> {
33 static const unsigned value = (ACC * 1313LLU + N) & 0xFFFFFFFF; 33 static const unsigned value = (ACC * 1313LLU + N) & 0xFFFFFFFF;
34 }; 34 };
35 35
36 template <unsigned ACC, wchar_t N, wchar_t... Ns> 36 template <unsigned ACC, wchar_t N, wchar_t... Ns>
37 struct CHash<ACC, N, Ns...> { 37 struct CHash<ACC, N, Ns...> {
38 static const unsigned value = CHash<CHash<ACC, N>::value, Ns...>::value; 38 static const unsigned value = CHash<CHash<ACC, N>::value, Ns...>::value;
39 }; 39 };
40 40
41 extern const unsigned int JSCONST_nStringHash = 41 const unsigned int JSCONST_nStringHash =
42 CHash<'s', 't', 'r', 'i', 'n', 'g'>::value; 42 CHash<'s', 't', 'r', 'i', 'n', 'g'>::value;
43 extern const unsigned int JSCONST_nNumberHash = 43 const unsigned int JSCONST_nNumberHash =
44 CHash<'n', 'u', 'm', 'b', 'e', 'r'>::value; 44 CHash<'n', 'u', 'm', 'b', 'e', 'r'>::value;
45 extern const unsigned int JSCONST_nBoolHash = 45 const unsigned int JSCONST_nBoolHash =
46 CHash<'b', 'o', 'o', 'l', 'e', 'a', 'n'>::value; 46 CHash<'b', 'o', 'o', 'l', 'e', 'a', 'n'>::value;
47 extern const unsigned int JSCONST_nDateHash = CHash<'d', 'a', 't', 'e'>::value; 47 const unsigned int JSCONST_nDateHash = CHash<'d', 'a', 't', 'e'>::value;
48 extern const unsigned int JSCONST_nObjectHash = 48 const unsigned int JSCONST_nObjectHash =
49 CHash<'o', 'b', 'j', 'e', 'c', 't'>::value; 49 CHash<'o', 'b', 'j', 'e', 'c', 't'>::value;
50 extern const unsigned int JSCONST_nFXobjHash = 50 const unsigned int JSCONST_nFXobjHash = CHash<'f', 'x', 'o', 'b', 'j'>::value;
51 CHash<'f', 'x', 'o', 'b', 'j'>::value; 51 const unsigned int JSCONST_nNullHash = CHash<'n', 'u', 'l', 'l'>::value;
52 extern const unsigned int JSCONST_nNullHash = CHash<'n', 'u', 'l', 'l'>::value; 52 const unsigned int JSCONST_nUndefHash =
53 extern const unsigned int JSCONST_nUndefHash =
54 CHash<'u', 'n', 'd', 'e', 'f', 'i', 'n', 'e', 'd'>::value; 53 CHash<'u', 'n', 'd', 'e', 'f', 'i', 'n', 'e', 'd'>::value;
55 54
56 #ifdef _DEBUG 55 #ifdef _DEBUG
57 class HashVerify { 56 class HashVerify {
58 public: 57 public:
59 HashVerify(); 58 HashVerify();
60 } g_hashVerify; 59 } g_hashVerify;
61 60
62 HashVerify::HashVerify() { 61 HashVerify::HashVerify() {
63 ASSERT(JSCONST_nStringHash == 62 ASSERT(JSCONST_nStringHash ==
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 return VT_boolean; 532 return VT_boolean;
534 if (nHash == JSCONST_nDateHash) 533 if (nHash == JSCONST_nDateHash)
535 return VT_date; 534 return VT_date;
536 if (nHash == JSCONST_nObjectHash) 535 if (nHash == JSCONST_nObjectHash)
537 return VT_object; 536 return VT_object;
538 if (nHash == JSCONST_nFXobjHash) 537 if (nHash == JSCONST_nFXobjHash)
539 return VT_fxobject; 538 return VT_fxobject;
540 539
541 return VT_unknown; 540 return VT_unknown;
542 } 541 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698