summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2015-02-21 15:44:23 -0500
committerAllen Winter <allen.winter@kdab.com>2015-02-21 15:44:23 -0500
commitad4e57acf60187b2ea1f1db5dae4ad9cdaa84973 (patch)
treea480a880c97aaba246fd096b02abac6fda770119 /scripts
parent2b0d50231b62ef15426d628e4f4ed91fb7193aa1 (diff)
downloadlibical-git-ad4e57acf60187b2ea1f1db5dae4ad9cdaa84973.tar.gz
scripts/mkderivedproperties.pl - add future space into the enum_map
else the hash math doesn't work and we'd need to search so let's use a little bit of extra memory instead.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mkderivedproperties.pl26
1 files changed, 19 insertions, 7 deletions
diff --git a/scripts/mkderivedproperties.pl b/scripts/mkderivedproperties.pl
index 58d6179e..04871205 100755
--- a/scripts/mkderivedproperties.pl
+++ b/scripts/mkderivedproperties.pl
@@ -86,6 +86,7 @@ if($opt_c){
print "{ICAL_${uc}_PROPERTY,\"\",ICAL_NO_VALUE}};\n\n";
$count = 1;
+ $bigcount = 0;
my %lines;
foreach $value (sort keys %valuemap) {
@@ -117,19 +118,30 @@ if($opt_c){
} else {
$str = "";
}
+ if($e eq "NONE"){
+ $bigcount += 100;
+ }
- # Place each property into a hash based on the index specified in value-types.csv
- # The lines are printed so they're in the same order as the indices
- $lines{$idx} = " {ICAL_${ucv}_PROPERTY,ICAL_${ucv}_${uce},\"$str\" }, /*$idx*/\n";
-
+ # Create empty "future" properties so the hash math works.
+ if ($e eq "NONE") {
+ my ($tbd) = 1;
+ $saveidx++;
+ for(; $saveidx<$idx; $saveidx++,$tbd++) {
+ $lines{$saveidx} = " {ICAL_${ucv}_PROPERTY,ICAL_${ucv}_NONE,\"\" }, /*$saveidx*/\n";
+ }
+ }
+ # Place each property into a hash based on the index specified in value-types.csv
+ # The lines are printed so they're in the same order as the indices
+ $lines{$idx} = " {ICAL_${ucv}_PROPERTY,ICAL_${ucv}_${uce},\"$str\" }, /*$idx*/\n";
+ $saveidx = $idx;
$count++;
}
-
}
}
- $count++;
- print "static const struct icalproperty_enum_map enum_map[$count] = {\n";
+ $bigcount++;
+
+ print "static const struct icalproperty_enum_map enum_map[$bigcount] = {\n";
foreach $line (sort keys %lines) {
print $lines{$line};
}