Permalink
Browse files

fix more dialyzer warnings

  • Loading branch information...
1 parent 1fcdfd7 commit b6ffe23070c14e7e86938eb693e88f21c0793c29 @vinoski vinoski committed Mar 1, 2011
Showing with 1 addition and 9 deletions.
  1. +1 −1 src/haxe.erl
  2. +0 −8 src/yaws_config.erl
View
@@ -367,7 +367,7 @@ scan_chars(Chars, Type) ->
Other
end.
-scan_chars(eof, A, _NumLeft) ->
+scan_chars([eof|_], A, _NumLeft) ->
{done, {error, premature_eof}, A};
scan_chars(Rest, A, 0) ->
{done, {ok, lists:reverse(A)}, Rest};
View
@@ -1203,10 +1203,6 @@ fload(FD, ssl, GC, C, Cs, Lno, Chars) ->
Err
end;
-fload(FD, rss, _GC, _C, _Cs, Lno, eof) ->
- file:close(FD),
- {error, ?F("Unexpected end of file at line ~w", [Lno])};
-
fload(FD, rss, GC, C, Cs, Lno, Chars) ->
%%?Debug("Chars: ~s", [Chars]),
Next = io:get_line(FD, ''),
@@ -1245,10 +1241,6 @@ fload(FD, rss, GC, C, Cs, Lno, Chars) ->
Err
end;
-fload(FD, opaque, _GC, _C, _Cs, Lno, eof) ->
- file:close(FD),
- {error, ?F("Unexpected end of file at line ~w", [Lno])};
-
fload(FD, opaque, GC, C, Cs, Lno, Chars) ->
%%?Debug("Chars: ~s", [Chars]),
Next = io:get_line(FD, ''),

3 comments on commit b6ffe23

I am not sure whether the change in haxe's code is the right one. I think that dialyzer is complaining that the scan_chars(eof, A, _NumLeft) clause is unreachable, not because its first argument is not wrapped in a list, but because the 'eof' atom has already been consumed in functions token_vsn1/1 and token_vsn2/1 functions which trigger the calls to scan_chars/3.

Anyway, you probably want to check that. I think the clause can simply be removed.

Another thing: while you check that, can you please also remove the confusing empty line in the middle of scan_chars/3's clauses?

Collaborator

vinoski replied Mar 2, 2011

Yes, it looks like the other scan_* functions are handling eof and so it can never reach the scan_chars function. Fixed in f0c19f.

Please sign in to comment.