Commit 9a9e0f97 authored by Bernhard Link's avatar Bernhard Link

fix FRACTION16_16, add FRACTION32_32

parent 4b5309e1
2010-03-22
* fix FRACTION16_16 on big-endian systems
* add FRACTION32_32
2010-01-21
* fix extension name output to not go to stdout unconditionaly
(Thanks to Tommi Komulainen)
......
......@@ -1036,10 +1036,20 @@ static size_t print_parameters(struct connection *c,const unsigned char *buffer,
if( print_offsets )
fprintf(out,"[%d]",(int)ofs);
fputs(p->name,out);putc('=',out);
i16 = getCARD32(ofs);
u16 = getCARD32(ofs + 2);
i16 = getCARD16(ofs);
u16 = getCARD16(ofs + 2);
fprintf(out,"%hd/%hu", i16, u16);
continue;
case ft_FRACTION32_32:
if( ofs + 8 > len )
continue;
if( print_offsets )
fprintf(out,"[%d]",(int)ofs);
fputs(p->name,out);putc('=',out);
i32 = getCARD32(ofs);
u32 = getCARD32(ofs + 4);
fprintf(out,"%d/%u", i32, u32);
continue;
case ft_EVENT:
if( len >= ofs + 32 )
print_event(c,buffer+ofs);
......@@ -1215,6 +1225,7 @@ static size_t print_parameters(struct connection *c,const unsigned char *buffer,
case ft_SET:
case ft_EVENT:
case ft_FRACTION16_16:
case ft_FRACTION32_32:
case ft_FIXED:
case ft_LISTofFIXED:
case ft_FLOAT32:
......
......@@ -106,6 +106,8 @@ struct parameter {
ft_LISTofFLOAT32,
/* fraction with nominator and denominator 16 bit */
ft_FRACTION16_16,
/* dito 32 bit */
ft_FRACTION32_32,
/* set stored value to specific value */
ft_DECREMENT_STORED,
ft_SET
......
......@@ -92,6 +92,7 @@ static const struct base_type {
{ "FORMAT8", ft_FORMAT8, SETS_FORMAT, 1},
{ "BE32", ft_BE32, ALLOWS_CONSTANTS, 4},
{ "FRACTION16_16", ft_FRACTION16_16, 0, 4},
{ "FRACTION32_32", ft_FRACTION32_32, 0, 8},
{ "FIXED", ft_FIXED, 0, 4},
{ "LISTofFIXED", ft_LISTofFIXED, USES_STORE|SETS_NEXT, 0},
{ "FLOAT32", ft_FLOAT32, 0, 4},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment