summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2016-06-11 11:31:25 -0400
committerAllen Winter <allen.winter@kdab.com>2016-06-11 11:31:25 -0400
commit1fdc582f5fd50b80344bbe9feb2486d64447a3e8 (patch)
tree78babea6ea648807d0e8a2a045e95ad88f47b1ed /scripts
parent20e3fb6f8f9ca3fe3d3861bf42d98f12428c310a (diff)
downloadlibical-git-1fdc582f5fd50b80344bbe9feb2486d64447a3e8.tar.gz
beautify the output code, tidy the perl, add some checks for Coverity
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mkderivedparameters.pl96
-rwxr-xr-xscripts/mkderivedproperties.pl104
-rwxr-xr-xscripts/mkderivedvalues.pl80
-rwxr-xr-xscripts/mkrestrictiontable.pl6
4 files changed, 158 insertions, 128 deletions
diff --git a/scripts/mkderivedparameters.pl b/scripts/mkderivedparameters.pl
index ad13dab4..163993e1 100755
--- a/scripts/mkderivedparameters.pl
+++ b/scripts/mkderivedparameters.pl
@@ -73,7 +73,7 @@ sub insert_code
$enumConst = $params{$param}->{"kindEnum"};
- print " ICAL_${uc}_PARAMETER = " . $enumConst . ", \n";
+ print " ICAL_${uc}_PARAMETER = " . $enumConst . ",\n";
}
$enumConst = $params{'NO'}->{"kindEnum"};
@@ -145,15 +145,15 @@ sub insert_code
next if $enum eq 'X' or $enum eq 'NONE';
next if $enum eq 'NO' or $enum eq 'ERROR';
$uc = join("", map {uc(lc($_));} split(/-/, $enum));
- $out .= " {ICAL_VALUE_${uc},ICAL_${uc}_VALUE},\n";
+ $out .= " {ICAL_VALUE_${uc}, ICAL_${uc}_VALUE},\n";
$count++;
}
$count += 2;
print "static const struct icalparameter_value_kind_map value_kind_map[$count] = {\n";
print $out;
- print " {ICAL_VALUE_X,ICAL_X_VALUE},\n";
- print " {ICAL_VALUE_NONE,ICAL_NO_VALUE}\n};\n\n";
+ print " {ICAL_VALUE_X, ICAL_X_VALUE},\n";
+ print " {ICAL_VALUE_NONE, ICAL_NO_VALUE}\n};\n\n";
#Create the parameter Name map
@@ -169,11 +169,11 @@ sub insert_code
my $uc = join("", map {uc(lc($_));} split(/-/, $param));
$count++;
- $out .= " {ICAL_${uc}_PARAMETER,\"$param\"},\n";
+ $out .= " {ICAL_${uc}_PARAMETER, \"$param\"},\n";
}
$count += 1;
- print "static const struct icalparameter_kind_map parameter_map[$count] = { \n";
+ print "static const struct icalparameter_kind_map parameter_map[$count] = {\n";
print $out;
print " { ICAL_NO_PARAMETER, \"\"}\n};\n\n";
@@ -201,7 +201,7 @@ sub insert_code
my $uce = join("", map {uc(lc($_));} split(/-/, $e));
$count++;
- $out .= " {ICAL_${uc}_PARAMETER,ICAL_${uc}_${uce},\"$e\"},\n";
+ $out .= " {ICAL_${uc}_PARAMETER,ICAL_${uc}_${uce}, \"$e\"},\n";
}
}
@@ -209,9 +209,9 @@ sub insert_code
$count += 3;
print "static const struct icalparameter_map icalparameter_map[] = {\n";
- print "{ICAL_ANY_PARAMETER,0,\"\"},\n";
+ print "{ICAL_ANY_PARAMETER, 0, \"\"},\n";
print $out;
- print " {ICAL_NO_PARAMETER,0,\"\"}};\n\n";
+ print " {ICAL_NO_PARAMETER, 0, \"\"}\n};\n\n";
}
@@ -233,37 +233,37 @@ sub insert_code
my $xrange;
if ($type =~ /char/) {
-
+ $type =~ s/char\*/char \*/;
$charorenum =
- " icalerror_check_arg_rz( (param!=0), \"param\");\n return param->string;";
+ " icalerror_check_arg_rz((param != 0), \"param\");\n return param->string;";
- $set_code = "((struct icalparameter_impl*)param)->string = icalmemory_strdup(v);";
+ $set_code = "((struct icalparameter_impl *)param)->string = icalmemory_strdup(v);";
- $pointer_check = "icalerror_check_arg_rz( (v!=0),\"v\");";
- $pointer_check_v = "icalerror_check_arg_rv( (v!=0),\"v\");";
+ $pointer_check = " icalerror_check_arg_rz((v != 0), \"v\");";
+ $pointer_check_v = "\n icalerror_check_arg_rv((v != 0), \"v\");";
} elsif ($type =~ /int/) {
$charorenum =
- " icalerror_check_arg( (param!=0), \"param\");\n$xrange\nreturn param->data;";
+ " icalerror_check_arg((param != 0), \"param\");\n$xrange\nreturn param->data;";
- $set_code = "((struct icalparameter_impl*)param)->data = v;";
+ $set_code = "((struct icalparameter_impl *)param)->data = v;";
} else {
- $xrange = " if (param->string != 0){\n return ICAL_${uc}_X;\n }\n"
+ $xrange = " if (param->string != 0) {\n return ICAL_${uc}_X;\n }\n"
if !exists $no_xname{$uc};
$charorenum =
- "icalerror_check_arg( (param!=0), \"param\");\n$xrange\nreturn ($type)(param->data);";
+" icalerror_check_arg((param != 0), \"param\");\n if (!param) {\n return ICAL_${uc}_NONE;\n }\n$xrange\nreturn ($type)(param->data);";
$pointer_check =
-"icalerror_check_arg_rz(v >= ICAL_${uc}_X,\"v\");\n icalerror_check_arg_rz(v < ICAL_${uc}_NONE,\"v\");";
+" icalerror_check_arg_rz(v >= ICAL_${uc}_X, \"v\");\n icalerror_check_arg_rz(v < ICAL_${uc}_NONE, \"v\");";
$pointer_check_v =
-"icalerror_check_arg_rv(v >= ICAL_${uc}_X,\"v\");\n icalerror_check_arg_rv(v < ICAL_${uc}_NONE,\"v\");";
+"\n icalerror_check_arg_rv(v >= ICAL_${uc}_X, \"v\");\n icalerror_check_arg_rv(v < ICAL_${uc}_NONE, \"v\");";
- $set_code = "((struct icalparameter_impl*)param)->data = (int)v;";
+ $set_code = "((struct icalparameter_impl *)param)->data = (int)v;";
}
@@ -271,40 +271,40 @@ sub insert_code
print <<EOM;
/* $param */
-icalparameter* icalparameter_new_${lc}($type v)
+icalparameter *icalparameter_new_${lc}($type v)
{
- struct icalparameter_impl *impl;
- icalerror_clear_errno();
- $pointer_check
- impl = icalparameter_new_impl(ICAL_${uc}_PARAMETER);
- if (impl == 0) {
- return 0;
- }
+ struct icalparameter_impl *impl;
+ icalerror_clear_errno();
+$pointer_check
+ impl = icalparameter_new_impl(ICAL_${uc}_PARAMETER);
+ if (impl == 0) {
+ return 0;
+ }
- icalparameter_set_${lc}((icalparameter*) impl,v);
- if (icalerrno != ICAL_NO_ERROR) {
- icalparameter_free((icalparameter*) impl);
- return 0;
- }
+ icalparameter_set_${lc}((icalparameter *)impl, v);
+ if (icalerrno != ICAL_NO_ERROR) {
+ icalparameter_free((icalparameter *)impl);
+ return 0;
+ }
- return (icalparameter*) impl;
+ return (icalparameter *)impl;
}
-${type} icalparameter_get_${lc}(const icalparameter* param)
+${type} icalparameter_get_${lc}(const icalparameter *param)
{
- icalerror_clear_errno();
+ icalerror_clear_errno();
$charorenum
}
-void icalparameter_set_${lc}(icalparameter* param, ${type} v)
-{
- $pointer_check_v
- icalerror_check_arg_rv( (param!=0), "param");
- icalerror_clear_errno();
+void icalparameter_set_${lc}(icalparameter *param, ${type} v)
+{$pointer_check_v
+ icalerror_check_arg_rv((param != 0), "param");
+ icalerror_clear_errno();
- if (param->string != NULL)
- free ((void*)param->string);
- $set_code
+ if (param->string != NULL) {
+ free((void *)param->string);
+ }
+ $set_code
}
EOM
@@ -313,9 +313,9 @@ EOM
print <<EOM;
/* $param */
-LIBICAL_ICAL_EXPORT icalparameter* icalparameter_new_${lc}($type v);
-LIBICAL_ICAL_EXPORT ${type} icalparameter_get_${lc}(const icalparameter* value);
-LIBICAL_ICAL_EXPORT void icalparameter_set_${lc}(icalparameter* value, ${type} v);
+LIBICAL_ICAL_EXPORT icalparameter * icalparameter_new_${lc}($type v);
+LIBICAL_ICAL_EXPORT ${type} icalparameter_get_${lc}(const icalparameter *value);
+LIBICAL_ICAL_EXPORT void icalparameter_set_${lc}(icalparameter *value, ${type} v);
EOM
diff --git a/scripts/mkderivedproperties.pl b/scripts/mkderivedproperties.pl
index a245a70c..a48ac0e8 100755
--- a/scripts/mkderivedproperties.pl
+++ b/scripts/mkderivedproperties.pl
@@ -64,7 +64,7 @@ sub fudge_data
my $ucvalue = uc($lcvalue);
my $type = $valuemap{$value}->{C}->[1];
-
+ $type =~ s/char\*/char \*/;
return ($uc, $lc, $lcvalue, $ucvalue, $type);
}
@@ -88,7 +88,7 @@ sub insert_code
my ($uc, $lc, $lcvalue, $ucvalue, $type) = fudge_data($prop);
- print "{ICAL_${uc}_PROPERTY,\"$prop\",ICAL_${ucvalue}_VALUE},\n";
+ print "{ICAL_${uc}_PROPERTY, \"$prop\", ICAL_${ucvalue}_VALUE},\n";
}
@@ -96,7 +96,7 @@ sub insert_code
my ($uc, $lc, $lcvalue, $ucvalue, $type) = fudge_data($prop);
- print "{ICAL_${uc}_PROPERTY,\"\",ICAL_NO_VALUE}};\n\n";
+ print "{ICAL_${uc}_PROPERTY, \"\", ICAL_NO_VALUE}};\n\n";
$count = 1;
$bigcount = 0;
@@ -141,13 +141,13 @@ sub insert_code
$saveidx++;
for (; $saveidx < $idx ; $saveidx++, $tbd++) {
$lines{$saveidx} =
- " {ICAL_${ucv}_PROPERTY,ICAL_${ucv}_NONE,\"\" }, /*$saveidx*/\n";
+ " {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";
+ $lines{$idx} = " {ICAL_${ucv}_PROPERTY,ICAL_${ucv}_${uce}, \"$str\" }, /*$idx*/\n";
$saveidx = $idx;
$count++;
}
@@ -160,7 +160,7 @@ sub insert_code
foreach $line (sort keys %lines) {
print $lines{$line};
}
- print " {ICAL_NO_PROPERTY,0,\"\"}\n};\n\n";
+ print " {ICAL_NO_PROPERTY, 0, \"\"}\n};\n\n";
}
@@ -179,11 +179,11 @@ sub insert_code
$enumConst = $propmap{$prop}->{"kindEnum"};
- print " ICAL_${uc}_PROPERTY = " . $enumConst . ", \n";
+ print " ICAL_${uc}_PROPERTY = " . $enumConst . ",\n";
}
$enumConst = $propmap{'NO'}->{"kindEnum"};
- print " ICAL_NO_PROPERTY = " . $enumConst . "\n} icalproperty_kind;\n\n";
+ print " ICAL_NO_PROPERTY = " . $enumConst . "\n} icalproperty_kind;\n";
}
@@ -197,40 +197,42 @@ sub insert_code
my $pointer_check;
if ($type =~ /\*/) {
- $pointer_check = "icalerror_check_arg_rz( (v!=0),\"v\");\n" if $type =~ /\*/;
+ $pointer_check = " icalerror_check_arg_rz((v != 0), \"v\");\n" if $type =~ /\*/;
} elsif ($type eq "void") {
- $pointer_check = "icalerror_check_arg_rv( (v!=0),\"v\");\n" if $type =~ /\*/;
+ $pointer_check = " icalerror_check_arg_rv((v != 0), \"v\");\n" if $type =~ /\*/;
}
- my $set_pointer_check = "icalerror_check_arg_rv( (v!=0),\"v\");\n" if $type =~ /\*/;
+ my $set_pointer_check = "\n icalerror_check_arg_rv((v != 0), \"v\");" if $type =~ /\*/;
if ($opt_c) { # Generate C source
if ($include_vanew) {
print <<EOM;
-icalproperty* icalproperty_vanew_${lc}($type v, ...){
- va_list args;
- struct icalproperty_impl *impl;
- $pointer_check
- impl= icalproperty_new_impl(ICAL_${uc}_PROPERTY);
- icalproperty_set_${lc}((icalproperty*)impl,v);
- va_start(args,v);
- icalproperty_add_parameters(impl, args);
- va_end(args);
- return (icalproperty*)impl;
+icalproperty *icalproperty_vanew_${lc}($type v, ...)
+{
+ va_list args;
+ struct icalproperty_impl *impl;
+$pointer_check
+ impl = icalproperty_new_impl(ICAL_${uc}_PROPERTY);
+ icalproperty_set_${lc}((icalproperty*)impl, v);
+ va_start(args, v);
+ icalproperty_add_parameters(impl, args);
+ va_end(args);
+ return (icalproperty*)impl;
}
EOM
}
print <<EOM;
/* $prop */
-icalproperty* icalproperty_new_${lc}($type v) {
- struct icalproperty_impl *impl;
- $pointer_check
- impl = icalproperty_new_impl(ICAL_${uc}_PROPERTY);
- icalproperty_set_${lc}((icalproperty*)impl,v);
- return (icalproperty*)impl;
+icalproperty *icalproperty_new_${lc}($type v)
+{
+ struct icalproperty_impl *impl;
+$pointer_check
+ impl = icalproperty_new_impl(ICAL_${uc}_PROPERTY);
+ icalproperty_set_${lc}((icalproperty*)impl, v);
+ return (icalproperty*)impl;
}
EOM
@@ -243,38 +245,43 @@ EOM
|| $lc eq "recurrenceid")
{
print <<EOM;
-void icalproperty_set_${lc}(icalproperty* prop, $type v){
+void icalproperty_set_${lc}(icalproperty *prop, $type v)
+{
icalvalue *value;
- $set_pointer_check
- icalerror_check_arg_rv( (prop!=0),"prop");
- if (v.is_date)
+$set_pointer_check
+ icalerror_check_arg_rv((prop != 0), "prop");
+ if (v.is_date) {
value = icalvalue_new_date(v);
- else
+ } else {
value = icalvalue_new_datetime(v);
- icalproperty_set_value(prop,value);
+ }
+ icalproperty_set_value(prop, value);
}
+
EOM
} else {
print <<EOM;
-void icalproperty_set_${lc}(icalproperty* prop, $type v){
- $set_pointer_check
- icalerror_check_arg_rv( (prop!=0),"prop");
- icalproperty_set_value(prop,icalvalue_new_${lcvalue}(v));
+void icalproperty_set_${lc}(icalproperty *prop, $type v)
+{$set_pointer_check
+ icalerror_check_arg_rv((prop != 0), "prop");
+ icalproperty_set_value(prop, icalvalue_new_${lcvalue}(v));
}
+
EOM
}
# Dirk Theisen pointed out, exdate needs to match TZID parameters in EXDATE
if ($lc eq "exdate") {
print <<EOM;
-$type icalproperty_get_${lc}(const icalproperty* prop){
+$type icalproperty_get_${lc}(const icalproperty *prop)
+{
#ifndef _MSC_VER
struct icaltimetype itt;
- icalparameter* param;
+ icalparameter *param;
icaltimezone *zone;
#endif
- icalerror_check_arg( (prop!=0),"prop");
+ icalerror_check_arg((prop != 0), "prop");
#ifndef _MSC_VER
/*
* Code by dirk\@objectpark.net:
@@ -293,25 +300,28 @@ $type icalproperty_get_${lc}(const icalproperty* prop){
return icalvalue_get_datetime(icalproperty_get_value(prop));
#endif
}
+
EOM
} else {
print <<EOM;
-$type icalproperty_get_${lc}(const icalproperty* prop){
- icalerror_check_arg( (prop!=0),"prop");
+$type icalproperty_get_${lc}(const icalproperty *prop)
+{
+ icalerror_check_arg((prop != 0), "prop");
return icalvalue_get_${lcvalue}(icalproperty_get_value(prop));
}
+
EOM
}
} elsif ($opt_h) { # Generate C Header file
print "\
/* $prop */\
-LIBICAL_ICAL_EXPORT icalproperty* icalproperty_new_${lc}($type v);\
-LIBICAL_ICAL_EXPORT void icalproperty_set_${lc}(icalproperty* prop, $type v);\
-LIBICAL_ICAL_EXPORT $type icalproperty_get_${lc}(const icalproperty* prop);";
+LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_${lc}($type v);\
+LIBICAL_ICAL_EXPORT void icalproperty_set_${lc}(icalproperty *prop, $type v);\
+LIBICAL_ICAL_EXPORT $type icalproperty_get_${lc}(const icalproperty *prop);";
if ($include_vanew) {
- print "\nLIBICAL_ICAL_EXPORT icalproperty* icalproperty_vanew_${lc}($type v, ...);\n";
+ print "\nLIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_${lc}($type v, ...);\n";
}
}
@@ -320,7 +330,7 @@ LIBICAL_ICAL_EXPORT $type icalproperty_get_${lc}(const icalproperty* prop);";
if ($opt_h) {
- print "\n\n#endif /*ICALPROPERTY_H*/\n";
+ print "\n#endif /*ICALPROPERTY_H*/\n";
}
}
diff --git a/scripts/mkderivedvalues.pl b/scripts/mkderivedvalues.pl
index 9efd93eb..f74f16e7 100755
--- a/scripts/mkderivedvalues.pl
+++ b/scripts/mkderivedvalues.pl
@@ -141,8 +141,7 @@ sub insert_code
}
$lastidx++;
- print "#define ICALPROPERTY_LAST_ENUM $lastidx\n\n";
-
+ print "#define ICALPROPERTY_LAST_ENUM $lastidx\n";
}
if ($opt_c) {
@@ -171,20 +170,21 @@ sub insert_code
my $autogen = $h{$value}->{C}->[0];
my $type = $h{$value}->{C}->[1];
+ $type =~ s/char\*/char \*/;
my $ucf = join("", map {ucfirst(lc($_));} split(/-/, $value));
my $lc = lc($ucf);
my $uc = uc($lc);
- my $pointer_check = "icalerror_check_arg_rz( (v!=0),\"v\");\n" if $type =~ /\*/;
- my $pointer_check_rv = "icalerror_check_arg_rv( (v!=0),\"v\");\n" if $type =~ /\*/;
+ my $pointer_check = " icalerror_check_arg_rz((v != 0), \"v\");\n" if $type =~ /\*/;
+ my $pointer_check_rv = " icalerror_check_arg_rv((v != 0), \"v\");\n" if $type =~ /\*/;
my $assign;
if ($type =~ /char/) {
$assign =
-"icalmemory_strdup(v);\n\n if (impl->data.v_string == 0){\n errno = ENOMEM;\n }\n";
+"icalmemory_strdup(v);\n\n if (impl->data.v_string == 0) {\n errno = ENOMEM;\n }\n";
} else {
$assign = "v;";
}
@@ -202,46 +202,64 @@ sub insert_code
if ($opt_c && $autogen) {
- print "\n\n\
-icalvalue* icalvalue_new_${lc} ($type v){\
- struct icalvalue_impl* impl;\
- $pointer_check\
- impl = icalvalue_new_impl(ICAL_${uc}_VALUE);\
- icalvalue_set_${lc}((icalvalue*)impl,v);\
- return (icalvalue*)impl;\
+ print "\
+icalvalue *icalvalue_new_${lc}($type v)\
+{\
+ struct icalvalue_impl *impl;\
+$pointer_check\
+ impl = icalvalue_new_impl(ICAL_${uc}_VALUE);\
+ icalvalue_set_${lc}((icalvalue *)impl, v);\
+ return (icalvalue*)impl;\
}\
-void icalvalue_set_${lc}(icalvalue* value, $type v) {\
- struct icalvalue_impl* impl; \
- icalerror_check_arg_rv( (value!=0),\"value\");\
- $pointer_check_rv\
+\
+void icalvalue_set_${lc}(icalvalue *value, $type v)\
+{\
+ struct icalvalue_impl *impl;\
+ icalerror_check_arg_rv((value != 0), \"value\");\
+$pointer_check_rv\
icalerror_check_value_type(value, ICAL_${uc}_VALUE);\
- impl = (struct icalvalue_impl*)value;\n";
+ impl = (struct icalvalue_impl *)value;\n";
if ($union_data eq 'string') {
- print " if(impl->data.v_${union_data}!=0) {free((void*)impl->data.v_${union_data});}\n";
+ print
+" if (impl->data.v_${union_data} != 0) {\n free((void *)impl->data.v_${union_data});\n }\n";
}
- print "\n\
- impl->data.v_$union_data = $assign \n\
- icalvalue_reset_kind(impl);\n}\n";
+ print "\
+ impl->data.v_$union_data = $assign\
+ icalvalue_reset_kind(impl);\n}\n\n";
- print "$type\ icalvalue_get_${lc} (const icalvalue* value) {\n\n";
+ print "$type\ icalvalue_get_${lc}(const icalvalue *value)\n{\n";
if ($union_data eq 'string') {
- print " icalerror_check_arg_rz ((value!=0),\"value\");\n";
+ print " icalerror_check_arg_rz((value != 0), \"value\");\n";
} else {
- print " icalerror_check_arg ((value!=0),\"value\");\n";
+ print " icalerror_check_arg((value != 0), \"value\");\n";
+ if ($union_data eq 'enum') {
+ print " if (!value) {\n return ICAL_${uc}_NONE;\n }\n";
+ } elsif ($union_data eq 'int') {
+ print " if (!value) {\n return 0;\n }\n";
+ } elsif ($union_data eq 'float') {
+ print " if (!value) {\n return 0.0;\n }\n";
+ } elsif ($union_data eq 'time') {
+ print " if (!value) {\n return icaltime_null_time();\n }\n";
+ } elsif ($union_data eq 'duration') {
+ print " if (!value) {\n return icaldurationtype_null_duration();\n }\n";
+ } elsif ($union_data eq 'period') {
+ print " if (!value) {\n return icalperiodtype_null_period();\n }\n";
+ } elsif ($union_data eq 'requeststatus') {
+ print " if (!value) {\n return icalreqstattype_from_string(\"0.0\");\n }\n";
+ }
}
- print " icalerror_check_value_type (value, ICAL_${uc}_VALUE);\
- return ((struct icalvalue_impl*)value)->data.v_${union_data};\n}\n";
+ print " icalerror_check_value_type(value, ICAL_${uc}_VALUE);\
+ return ((struct icalvalue_impl *)value)->data.v_${union_data};\n}\n";
} elsif ($opt_h && $autogen) {
- print "\n /* $value */ \
-LIBICAL_ICAL_EXPORT icalvalue* icalvalue_new_${lc}($type v); \
-LIBICAL_ICAL_EXPORT $type icalvalue_get_${lc}(const icalvalue* value); \
-LIBICAL_ICAL_EXPORT void icalvalue_set_${lc}(icalvalue* value, ${type} v);\n\n";
-
+ print "\n/* $value */\
+LIBICAL_ICAL_EXPORT icalvalue *icalvalue_new_${lc}($type v);\
+LIBICAL_ICAL_EXPORT $type icalvalue_get_${lc}(const icalvalue *value);\
+LIBICAL_ICAL_EXPORT void icalvalue_set_${lc}(icalvalue *value, ${type} v);\n";
}
}
diff --git a/scripts/mkrestrictiontable.pl b/scripts/mkrestrictiontable.pl
index 5669bddd..ca22f20d 100755
--- a/scripts/mkrestrictiontable.pl
+++ b/scripts/mkrestrictiontable.pl
@@ -66,17 +66,19 @@ sub insert_code
} else {
$sub = "icalrestriction_" . $sub;
}
+ $restr =~ s/\s+$//;
if ($prop ne "NONE") {
print(
-" \{ICAL_METHOD_${method},ICAL_${targetcomp}_COMPONENT,ICAL_${prop}_PROPERTY,ICAL_RESTRICTION_${restr},$sub},\n"
+" \{ICAL_METHOD_${method}, ICAL_${targetcomp}_COMPONENT, ICAL_${prop}_PROPERTY, ICAL_RESTRICTION_${restr}, $sub},\n"
);
}
}
# Print the terminating line
- print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_RESTRICTION_NONE,NULL}\n";
+ print
+ " {ICAL_METHOD_NONE, ICAL_NO_COMPONENT, ICAL_NO_PROPERTY, ICAL_RESTRICTION_NONE, NULL}\n";
print "};\n";