Changeset 72664 in webkit
- Timestamp:
- Nov 24, 2010 5:26:59 AM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r72660 r72664 1 2010-11-24 Patrick Gansterer <paroga@webkit.org> 2 3 Reviewed by Csaba Osztrogonác. 4 5 Simplify make-hash-tools.pl 6 https://bugs.webkit.org/show_bug.cgi?id=49922 7 8 HashTools.h does not need to be generated, because it only contains static code. 9 10 * html/DocTypeStrings.gperf: Include findDoctypeEntry function. 11 * make-hash-tools.pl: Do not generate HashTools.h. 12 * platform/ColorData.gperf: Include findColor function. 13 * platform/HashTools.h: Added. 14 1 15 2010-11-24 Andreas Kling <kling@webkit.org> 2 16 -
trunk/WebCore/html/DocTypeStrings.gperf
r68563 r72664 1 %{ 2 #include "HashTools.h" 3 #include <string.h> 4 5 namespace WebCore { 6 %} 1 7 %struct-type 2 8 struct PubIDInfo; … … 89 95 "-/w3c/dtd html 4.0 transitional/en", PubIDInfo::eQuirks, PubIDInfo::eQuirks 90 96 "html", PubIDInfo::eQuirks3, PubIDInfo::eQuirks3 97 %% 98 const PubIDInfo* findDoctypeEntry(register const char* str, register unsigned int len) 99 { 100 return DocTypeStringsHash::findDoctypeEntryImpl(str, len); 101 } 102 103 } // namespace WebCore -
trunk/WebCore/make-hash-tools.pl
r69937 r72664 28 28 my $option = basename($ARGV[0],".gperf"); 29 29 30 my $hashToolsHeader = "$outdir/HashTools.h";31 32 sub createHashToolsHeader() {33 34 open HEADER, ">$hashToolsHeader" || die "Could not open $hashToolsHeader for writing";35 print HEADER << "EOF";36 /* This file is automatically generated by make-hash-tools.pl, do not edit */37 38 #ifndef HashTools_h39 #define HashTools_h40 41 #include "wtf/Platform.h"42 43 namespace WebCore {44 45 struct PubIDInfo {46 enum eMode {47 eQuirks,48 eQuirks3,49 eAlmostStandards50 };51 52 const char* name;53 eMode mode_if_no_sysid;54 eMode mode_if_sysid;55 };56 57 struct NamedColor {58 const char* name;59 unsigned ARGBValue;60 };61 62 struct Property {63 const char* name;64 int id;65 };66 67 struct Value {68 const char* name;69 int id;70 };71 72 const PubIDInfo* findDoctypeEntry(register const char* str, register unsigned int len);73 const NamedColor* findColor(register const char* str, register unsigned int len);74 const Property* findProperty(register const char* str, register unsigned int len);75 const Value* findValue(register const char* str, register unsigned int len);76 }77 78 #endif // HashTools_h79 80 EOF81 close HEADER;82 83 }84 30 85 31 switch ($option) { … … 87 33 case "DocTypeStrings" { 88 34 89 createHashToolsHeader(); 90 91 my $docTypeStringsImpl = "$outdir/DocTypeStrings.cpp"; 92 my $docTypeStringsGenerated = "$outdir/DocTypeStringsHash.h"; 35 my $docTypeStringsGenerated = "$outdir/DocTypeStrings.cpp"; 93 36 my $docTypeStringsGperf = $ARGV[0]; 94 37 shift; 95 96 open DOCTYPESTRINGS, ">$docTypeStringsImpl" || die "Could not open $docTypeStringsImpl for writing";97 print DOCTYPESTRINGS << "EOF";98 /* This file is automatically generated by make-hash-tools.pl, do not edit */99 100 #include <string.h>101 #include "HashTools.h"102 103 namespace WebCore {104 #include "DocTypeStringsHash.h"105 106 const PubIDInfo* findDoctypeEntry (register const char* str, register unsigned int len)107 {108 return DocTypeStringsHash::findDoctypeEntryImpl(str, len);109 }110 111 }112 113 EOF114 close DOCTYPESTRINGS;115 38 116 39 system("gperf --key-positions=\"*\" -s 2 $docTypeStringsGperf > $docTypeStringsGenerated") == 0 || die "calling gperf failed: $?"; … … 120 43 case "ColorData" { 121 44 122 my $colorDataImpl = "$outdir/ColorData.cpp"; 123 my $colorDataGenerated = "$outdir/ColorDataHash.h"; 45 my $colorDataGenerated = "$outdir/ColorData.cpp"; 124 46 my $colorDataGperf = $ARGV[0]; 125 47 shift; 126 127 open COLORDATA, ">$colorDataImpl" || die "Could not open $colorDataImpl for writing";128 print COLORDATA << "EOF";129 /* This file is automatically generated by make-hash-tools.pl, do not edit */130 131 #include <string.h>132 #include "HashTools.h"133 134 namespace WebCore {135 #include "ColorDataHash.h"136 137 const struct NamedColor* findColor (register const char* str, register unsigned int len)138 {139 return ColorDataHash::findColorImpl(str, len);140 }141 142 }143 144 EOF145 close COLORDATA;146 48 147 49 system("gperf --key-positions=\"*\" -D -s 2 $colorDataGperf > $colorDataGenerated") == 0 || die "calling gperf failed: $?"; -
trunk/WebCore/platform/ColorData.gperf
r69937 r72664 1 %{ 2 #include "HashTools.h" 3 #include <string.h> 4 5 namespace WebCore { 6 %} 1 7 %struct-type 2 8 struct NamedColor; … … 161 167 yellow, 0xffffff00 162 168 yellowgreen, 0xff9acd32 169 %% 170 const struct NamedColor* findColor(register const char* str, register unsigned int len) 171 { 172 return ColorDataHash::findColorImpl(str, len); 173 } 174 175 } // namespace WebCore
Note: See TracChangeset
for help on using the changeset viewer.