Changeset 72667 in webkit
- Timestamp:
- Nov 24, 2010 6:51:14 AM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r72666 r72667 1 2010-11-24 Patrick Gansterer <paroga@webkit.org> 2 3 Reviewed by Csaba Osztrogonác. 4 5 Simplify makevalues.pl 6 https://bugs.webkit.org/show_bug.cgi?id=49926 7 8 Don't generate CSSValueKeywordsHash.h. 9 Instead generate CSSValueKeywords.cpp directly. 10 11 * GNUmakefile.am: Removed rule for CSSValueKeywordsHash.h. 12 * css/makevalues.pl: 13 1 14 2010-11-24 Andras Becsi <abecsi@inf.u-szeged.hu> 2 15 -
trunk/WebCore/GNUmakefile.am
r72614 r72667 98 98 DerivedSources/WebCore/CSSValueKeywords.h \ 99 99 DerivedSources/WebCore/CSSValueKeywords.cpp \ 100 DerivedSources/WebCore/CSSValueKeywordsHash.h \101 100 DerivedSources/WebCore/ColorData.cpp \ 102 101 DerivedSources/WebCore/DocTypeStrings.cpp \ … … 4590 4589 4591 4590 # Lower case all the values, as CSS values are case-insensitive 4592 DerivedSources/WebCore/CSSValueKeywordsHash.h: DerivedSources/WebCore/CSSValueKeywords.cpp4593 4591 DerivedSources/WebCore/CSSValueKeywords.cpp: DerivedSources/WebCore/CSSValueKeywords.h 4594 4592 DerivedSources/WebCore/CSSValueKeywords.h: $(WEBCORE_CSS_VALUE_KEYWORDS) $(WebCore)/css/makevalues.pl -
trunk/WebCore/css/makevalues.pl
r68521 r72667 41 41 42 42 #include \"CSSValueKeywords.h\" 43 #include \"HashTools.h\" 44 #include <string.h> 45 46 namespace WebCore { 43 47 %} 44 48 %struct-type … … 52 56 %define hash-function-name value_hash_function 53 57 %define word-array-name value_word_list 54 %includes55 58 %enum 56 59 %% … … 62 65 print GPERF $name . ", CSSValue" . $id . "\n"; 63 66 } 64 print GPERF "%%\n"; 67 68 print GPERF << "EOF"; 69 %% 70 static const char* const valueList[] = { 71 "", 72 EOF 73 74 foreach my $name (@names) { 75 print GPERF " \"" . $name . "\",\n"; 76 } 77 78 print GPERF << "EOF"; 79 0 80 }; 81 82 const Value* findValue(register const char* str, register unsigned int len) 83 { 84 return CSSValueKeywordsHash::findValueImpl(str, len); 85 } 86 87 const char* getValueName(unsigned short id) 88 { 89 if (id >= numCSSValueKeywords || id <= 0) 90 return 0; 91 return valueList[id]; 92 } 93 94 } // namespace WebCore 95 EOF 65 96 close GPERF; 97 66 98 67 99 open HEADER, ">CSSValueKeywords.h" || die "Could not open CSSValueKeywords.h for writing"; … … 103 135 close HEADER; 104 136 105 system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywordsHash.h") == 0 || die "calling gperf failed: $?"; 106 107 open C, ">>CSSValueKeywordsHash.h" || die "Could not open CSSValueKeywordsHash.h for writing"; 108 print C "static const char * const valueList[] = {\n"; 109 print C "\"\",\n"; 110 foreach my $name (@names) { 111 print C "\"" . $name . "\", \n"; 112 } 113 print C << "EOF"; 114 0 115 }; 116 117 EOF 118 119 close C; 120 121 my $valueKeywordsImpl = "CSSValueKeywords.cpp"; 122 123 open VALUEKEYWORDS, ">$valueKeywordsImpl" || die "Could not open $valueKeywordsImpl for writing"; 124 print VALUEKEYWORDS << "EOF"; 125 /* This file is automatically generated by make-hash-tools.pl, do not edit */ 126 127 #include "CSSValueKeywords.h" 128 #include "HashTools.h" 129 130 namespace WebCore { 131 #include "CSSValueKeywordsHash.h" 132 133 const Value* findValue (register const char* str, register unsigned int len) 134 { 135 return CSSValueKeywordsHash::findValueImpl(str, len); 136 } 137 138 const char* getValueName(unsigned short id) 139 { 140 if (id >= numCSSValueKeywords || id <= 0) 141 return 0; 142 return valueList[id]; 143 } 144 145 } // namespace WebCore 146 147 EOF 148 149 close VALUEKEYWORDS; 150 137 system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywords.cpp") == 0 || die "calling gperf failed: $?";
Note: See TracChangeset
for help on using the changeset viewer.