Changeset 72672 in webkit


Ignore:
Timestamp:
Nov 24, 2010 7:51:54 AM (13 years ago)
Author:
Patrick Gansterer
Message:

2010-11-24 Patrick Gansterer <Patrick Gansterer>

Reviewed by Csaba Osztrogonác.

Simplify makeprop.pl
https://bugs.webkit.org/show_bug.cgi?id=49925

Don't generate CSSPropertyNamesHash.h.
Instead generate CSSPropertyNames directly.

  • GNUmakefile.am: Removed rule for CSSPropertyNamesHash.h.
  • css/makeprop.pl:
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r72669 r72672  
     12010-11-24  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Reviewed by Csaba Osztrogonác.
     4
     5        Simplify makeprop.pl
     6        https://bugs.webkit.org/show_bug.cgi?id=49925
     7
     8        Don't generate CSSPropertyNamesHash.h.
     9        Instead generate CSSPropertyNames directly.
     10
     11        * GNUmakefile.am: Removed rule for CSSPropertyNamesHash.h.
     12        * css/makeprop.pl:
     13
    1142010-11-24  Patrick Gansterer  <paroga@webkit.org>
    215
  • trunk/WebCore/GNUmakefile.am

    r72667 r72672  
    9595        DerivedSources/WebCore/CSSPropertyNames.h \
    9696        DerivedSources/WebCore/CSSPropertyNames.cpp \
    97         DerivedSources/WebCore/CSSPropertyNamesHash.h \
    9897        DerivedSources/WebCore/CSSValueKeywords.h \
    9998        DerivedSources/WebCore/CSSValueKeywords.cpp \
     
    45804579endif  # END ENABLE_BLOB
    45814580
    4582 DerivedSources/WebCore/CSSPropertyNamesHash.h: DerivedSources/WebCore/CSSPropertyNames.cpp
    45834581DerivedSources/WebCore/CSSPropertyNames.cpp: DerivedSources/WebCore/CSSPropertyNames.h
    45844582DerivedSources/WebCore/CSSPropertyNames.h: $(WEBCORE_CSS_PROPERTY_NAMES) $(WebCore)/css/makeprop.pl
  • trunk/WebCore/css/makeprop.pl

    r68521 r72672  
    4040/* This file is automatically generated from CSSPropertyNames.in by makeprop, do not edit */
    4141#include \"CSSPropertyNames.h\"
     42#include \"HashTools.h\"
     43#include <string.h>
     44
     45namespace WebCore {
    4246%}
    4347%struct-type
     
    5256%define hash-function-name propery_hash_function
    5357%define word-array-name property_wordlist
    54 %includes
    5558%enum
    5659%%
     
    6265  print GPERF $name . ", CSSProperty" . $id . "\n";
    6366}
    64 print GPERF "%%\n";
    65 close GPERF;
     67
     68print GPERF<< "EOF";
     69%%
     70const Property* findProperty(register const char* str, register unsigned int len)
     71{
     72    return CSSPropertyNamesHash::findPropertyImpl(str, len);
     73}
     74
     75const char* getPropertyName(CSSPropertyID id)
     76{
     77    if (id < firstCSSProperty)
     78        return 0;
     79    int index = id - firstCSSProperty;
     80    if (index >= numCSSProperties)
     81        return 0;
     82    return propertyNameStrings[index];
     83}
     84
     85} // namespace WebCore
     86EOF
    6687
    6788open HEADER, ">CSSPropertyNames.h" || die "Could not open CSSPropertyNames.h for writing";
     
    117138close HEADER;
    118139
    119 system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNamesHash.h") == 0 || die "calling gperf failed: $?";
    120 
    121 open C, ">>CSSPropertyNamesHash.h" || die "Could not open CSSPropertyNamesHash.h for writing";
    122 print C << "EOF";
    123 
    124 EOF
    125 
    126 close C;
    127 
    128 my $propertyNamesImpl = "CSSPropertyNames.cpp";
    129 
    130 open PROPERTYNAMES, ">$propertyNamesImpl" || die "Could not open $propertyNamesImpl for writing";
    131 print PROPERTYNAMES << "EOF";
    132 /* This file is automatically generated by make-hash-tools.pl, do not edit */
    133 
    134 
    135 #include "CSSPropertyNames.h"
    136 #include "HashTools.h"
    137 
    138 namespace WebCore {
    139 #include "CSSPropertyNamesHash.h"
    140 
    141 const Property* findProperty (register const char* str, register unsigned int len)
    142 {
    143     return CSSPropertyNamesHash::findPropertyImpl(str, len);
    144 }
    145 
    146 const char* getPropertyName(CSSPropertyID id)
    147 {
    148     if (id < firstCSSProperty)
    149         return 0;
    150     int index = id - firstCSSProperty;
    151     if (index >= numCSSProperties)
    152         return 0;
    153     return propertyNameStrings[index];
    154 }
    155 
    156 } // namespace WebCore
    157 
    158 EOF
    159 
    160 close PROPERTYNAMES;
    161 
     140system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNames.cpp") == 0 || die "calling gperf failed: $?";
Note: See TracChangeset for help on using the changeset viewer.