Re: [PATCH 3/5] remote generator: Unify unsigned int notation in .x files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/5/9 Eric Blake <eblake@xxxxxxxxxx>:
> On 05/07/2011 06:28 AM, Matthias Bolte wrote:
>> Rename u_int and unsigned to unsigned int. This gets rid of some special
>> case code in the generator.
>> ---
>> Âdaemon/remote_generator.pl  |  10 +++---
>> Âsrc/remote/remote_protocol.x | Â 72 +++++++++++++++++++++---------------------
>> Â2 files changed, 41 insertions(+), 41 deletions(-)
>>
>> diff --git a/daemon/remote_generator.pl b/daemon/remote_generator.pl
>> index 8d62c37..e6a0e2c 100755
>> --- a/daemon/remote_generator.pl
>> +++ b/daemon/remote_generator.pl
>> @@ -878,13 +878,13 @@ elsif ($opt_k) {
>> Â Â Â Â Â Â Â Â Â Â Âpush(@setters_list, "args.$1.${1}_val = (char *)$1;");
>> Â Â Â Â Â Â Â Â Â Â Âpush(@setters_list, "args.$1.${1}_len = ${1}len;");
>> Â Â Â Â Â Â Â Â Â Â Âpush(@args_check_list, { name => "\"$1\"", arg => "${1}len", limit => $2 });
>> - Â Â Â Â Â Â Â Â} elsif ($args_member =~ m/^(.*) (\S+);/) {
>> - Â Â Â Â Â Â Â Â Â Âmy $type_name = $1;
>> - Â Â Â Â Â Â Â Â Â Âmy $arg_name = $2;
>> + Â Â Â Â Â Â Â Â} elsif ($args_member =~ m/^(unsigned )?(int|hyper) (\S+);/) {
>> + Â Â Â Â Â Â Â Â Â Âmy $type_name;
>> + Â Â Â Â Â Â Â Â Â Âmy $arg_name = $3;
>>
>> + Â Â Â Â Â Â Â Â Â Â$type_name = $1 if ($1);
>> + Â Â Â Â Â Â Â Â Â Â$type_name .= $2;
>> Â Â Â Â Â Â Â Â Â Â Â$type_name =~ s/hyper/long/;
>> - Â Â Â Â Â Â Â Â Â Â$type_name =~ s/^unsigned$/unsigned int/;
>> - Â Â Â Â Â Â Â Â Â Â$type_name =~ s/u_int/unsigned int/;
>
> Makes sense. ÂCertainly makes life stricter for $type_name, which is a
> good thing for maintenance.
>
>> +++ b/src/remote/remote_protocol.x
>> @@ -541,8 +541,8 @@ struct remote_domain_interface_stats_ret {
>>
>> Âstruct remote_domain_memory_stats_args {
>> Â Â Âremote_nonnull_domain dom;
>> - Â Âu_int maxStats;
>> - Â Âu_int flags;
>> + Â Âunsigned int maxStats;
>> + Â Âunsigned int flags;
>
> Good change; http://www.ietf.org/rfc/rfc4506.txt only documents
> 'unsigned int identifier' [4.2], and not 'u_int' nor 'unsigned' for
> declaring unsigned 32-bit values. Ârpcgen may have accepted those other
> aliases as an extension (or via an intermediate typedef), but we might
> as well stick as close to the specs as possible, especially if it makes
> life easier for our generator.
>
> ACK.
>

Thanks, pushed.

Matthias

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]