summaryrefslogtreecommitdiff
path: root/src/rabbit_binary_generator.erl
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2014-01-07 23:10:34 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2014-01-07 23:10:34 +0000
commitdf441447d4d9c1044cce20a37713b00aa3a4fc23 (patch)
tree6c59983f33b26666e1a340948f8f930be6f969bf /src/rabbit_binary_generator.erl
parent220b62f2b8ea599dc33497243dc3584a8ff0fa6e (diff)
downloadrabbitmq-server-df441447d4d9c1044cce20a37713b00aa3a4fc23.tar.gz
it turns out that dialyzer dislikes improper lists
...and spits out "Cons will produce an improper list" errors *sigh*
Diffstat (limited to 'src/rabbit_binary_generator.erl')
-rw-r--r--src/rabbit_binary_generator.erl20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/rabbit_binary_generator.erl b/src/rabbit_binary_generator.erl
index 8eaac10d..ce120721 100644
--- a/src/rabbit_binary_generator.erl
+++ b/src/rabbit_binary_generator.erl
@@ -122,16 +122,16 @@ table_field_to_binary({FName, T, V}) ->
field_value_to_binary(longstr, V) -> [$S | long_string_to_binary(V)];
field_value_to_binary(signedint, V) -> [$I | <<V:32/signed>>];
field_value_to_binary(decimal, V) -> {Before, After} = V,
- [$D | [Before, <<After:32>>]];
-field_value_to_binary(timestamp, V) -> [$T | <<V:64>>];
+ [$D, Before, <<After:32>>];
+field_value_to_binary(timestamp, V) -> [$T, <<V:64>>];
field_value_to_binary(table, V) -> [$F | table_to_binary(V)];
field_value_to_binary(array, V) -> [$A | array_to_binary(V)];
-field_value_to_binary(byte, V) -> [$b | <<V:8/unsigned>>];
-field_value_to_binary(double, V) -> [$d | <<V:64/float>>];
-field_value_to_binary(float, V) -> [$f | <<V:32/float>>];
-field_value_to_binary(long, V) -> [$l | <<V:64/signed>>];
-field_value_to_binary(short, V) -> [$s | <<V:16/signed>>];
-field_value_to_binary(bool, V) -> [$t | [if V -> 1; true -> 0 end]];
+field_value_to_binary(byte, V) -> [$b, <<V:8/unsigned>>];
+field_value_to_binary(double, V) -> [$d, <<V:64/float>>];
+field_value_to_binary(float, V) -> [$f, <<V:32/float>>];
+field_value_to_binary(long, V) -> [$l, <<V:64/signed>>];
+field_value_to_binary(short, V) -> [$s, <<V:16/signed>>];
+field_value_to_binary(bool, V) -> [$t, if V -> 1; true -> 0 end];
field_value_to_binary(binary, V) -> [$x | long_string_to_binary(V)];
field_value_to_binary(void, _V) -> [$V].
@@ -154,13 +154,13 @@ generate_array_iolist(Array) ->
short_string_to_binary(String) ->
Len = string_length(String),
- if Len < 256 -> [<<Len:8>> | String];
+ if Len < 256 -> [<<Len:8>>, String];
true -> exit(content_properties_shortstr_overflow)
end.
long_string_to_binary(String) ->
Len = string_length(String),
- [<<Len:32>> | String].
+ [<<Len:32>>, String].
string_length(String) when is_binary(String) -> size(String);
string_length(String) -> length(String).