Permalink
Browse files

Eliminated warnings.

git-svn-id: https://wings.svn.sourceforge.net/svnroot/wings/trunk@206 a0a82711-911a-0410-9f52-85ee3e23afd8
  • Loading branch information...
1 parent 3cc88cc commit 91004001f1c861f16585d30b26182d6058325372 @bjorng bjorng committed Jan 4, 2008
Showing with 20 additions and 19 deletions.
  1. +5 −5 e3d/e3d__tga.erl
  2. +6 −6 e3d/e3d__tif.erl
  3. +4 −3 e3d/e3d_bv.erl
  4. +4 −4 e3d/e3d_image.erl
  5. +1 −1 e3d/e3d_tds.erl
View
@@ -3,12 +3,12 @@
%%
%% Functions for reading and writing TGA files.
%%
-%% Copyright (c) 2001-2004 Dan Gudmundsson
+%% Copyright (c) 2001-2008 Dan Gudmundsson
%%
%% See the file "license.terms" for information on usage and redistribution
%% of this file, and for a DISCLAIMER OF ALL WARRANTIES.
%%
-%% $Id: e3d__tga.erl,v 1.15 2004/01/02 21:09:29 bjorng Exp $
+%% $Id$
%%
-module(e3d__tga).
@@ -56,7 +56,7 @@ load_mapped(Len,Bitpp,Comp,Skip,
MapSz = (Len*Bpp),
<<_:Skip/binary,MapBin0:MapSz/binary,Image0/binary>> = Raw,
case to_8bitpp(MapBin0,Bitpp,Alpha) of
- MapBin when binary(MapBin) ->
+ MapBin when is_binary(MapBin) ->
Map = get_map(MapSz,Bpp,MapBin,[]),
Image = case Comp of
false ->
@@ -84,7 +84,7 @@ load_uncomp(Skip,<<W:16/little,H:16/little,BitsPP:8,0:1,0:1,
Size = BytesPerPixel * W * H,
<<_:Skip/binary, RealImage:Size/binary, _Rest/binary>> = Image,
case to_8bitpp(RealImage,BitsPP,Alpha) of
- Bin when binary(Bin) ->
+ Bin when is_binary(Bin) ->
#e3d_image{width = W, height = H, type = Type,
order = get_order(Order),
bytes_pp = e3d_image:bytes_pp(Type),
@@ -102,7 +102,7 @@ load_comp(Skip, Bin0) ->
Size = W * H,
Image = load_comp(CImage, Size, BytesPerPixel, []),
case to_8bitpp(Image,BitsPP,Alpha) of
- Bin when binary(Bin) ->
+ Bin when is_binary(Bin) ->
#e3d_image{width = W, height = H, type = Type,
order = get_order(Order),
bytes_pp = e3d_image:bytes_pp(Type),
View
@@ -597,15 +597,15 @@ lzw_decomp(S, Read, PrevCode, Count, BitLen, Acc) ->
{?LZW_EOI, _} ->
%% io:format("~nEOI-2 ~p ~n", [{S, PrevCode, Count, BitLen}]),
Acc;
- {NewCode, NS2} when integer(NewCode) ->
+ {NewCode, NS2} when is_integer(NewCode) ->
Str = ?get_lzw(NewCode),
lzw_decomp(NS2, Read, NewCode, 258, 9, [Str|Acc]);
Else ->
io:format("~n~p: Error ~p Args: ~p ~n",
[?MODULE, Else, {NS, PrevCode, Count, BitLen}]),
exit({badly_compressed_data})
end;
- {NewCode, NS} when integer(NewCode) ->
+ {NewCode, NS} when is_integer(NewCode) ->
case ?get_lzw(NewCode) of
undefined when Count == NewCode ->
OldStr = [H|_] = ?get_lzw(PrevCode),
@@ -671,7 +671,7 @@ lzw_compress(<<>>, CC, _W, Omega, BitLen, _TabCount, Build, Acc) ->
{{TotBitLen, Codes}, N2acc} = lzw_write({NewBL,?LZW_EOI}, NBuild, Nacc),
PaddL = 8 - (TotBitLen rem 8),
case catch lzw_buildbin(lists:reverse([{PaddL, 0}|Codes])) of
- Bin when binary(Bin) ->
+ Bin when is_binary(Bin) ->
list_to_binary(lists:reverse([Bin|N2acc]));
_Else ->
io:format("~p:~p Error ~p ~p ~n", [?MODULE, ?LINE, {PaddL, Codes}, CC]),
@@ -709,9 +709,9 @@ lzw_write({CLen, Code}, {Totlen, List}, Acc) ->
if
NewLen rem 8 == 0 ->
case catch lzw_buildbin(lists:reverse([{CLen,Code}|List])) of
- Bin when binary(Bin) ->
+ Bin when is_binary(Bin) ->
{{0, []}, [Bin|Acc]};
- {Bin, NewList} when binary(Bin) ->
+ {Bin, NewList} when is_binary(Bin) ->
Sum = lists:foldl(fun({X,_}, Sum) -> X + Sum end, 0, NewList),
{{Sum, lists:reverse(NewList)}, [Bin|Acc]};
Else ->
@@ -721,7 +721,7 @@ lzw_write({CLen, Code}, {Totlen, List}, Acc) ->
end;
NewLen > 100 ->
case catch lzw_buildbin(lists:reverse([{CLen,Code}|List])) of
- {Bin, NewList} when binary(Bin) ->
+ {Bin, NewList} when is_binary(Bin) ->
Sum = lists:foldl(fun({X,_}, Sum) -> X + Sum end, 0, NewList),
{{Sum, lists:reverse(NewList)}, [Bin|Acc]};
Else ->
View
@@ -3,12 +3,13 @@
%%
%% Bounding volume operations.
%% Currently only quickhull, and eigen-vecs calculation implemented
-%% Copyright (c) 2001-2005 Dan Gudmundsson
+%%
+%% Copyright (c) 2001-2008 Dan Gudmundsson
%%
%% See the file "license.terms" for information on usage and redistribution
%% of this file, and for a DISCLAIMER OF ALL WARRANTIES.
%%
-%% $Id: e3d_bv.erl,v 1.1 2005/05/03 16:23:08 dgud Exp $
+%% $Id$
%%
-module(e3d_bv).
@@ -30,7 +31,7 @@ eigen_vecs(Vs) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%% QHULL %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-record(hull, {f,p,os}).
%% Splits a point soup in a convex-triangle-hull.
-quickhull([V1,V2|Vs0]) when list(Vs0) ->
+quickhull([V1,V2|Vs0]) when is_list(Vs0) ->
%% Init find an initial triangle..
[M1,M2] = if V1 < V2 -> [V1,V2]; true -> [V2,V1] end,
{T1,T2,[T30|Vs1]} = minmax_x(Vs0,M1,M2,[]),
View
@@ -3,7 +3,7 @@
%%
%% Handle images (2D) and different file formats.
%%
-%% Copyright (c) 2001-2004 Dan Gudmundsson
+%% Copyright (c) 2001-2008 Dan Gudmundsson
%%
%% See the file "license.terms" for information on usage and redistribution
%% of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -43,7 +43,7 @@
%% Options {type, Type} and/or {alignment, N} and/or {order, O} see e3d_image.hrl
load(FileName) ->
load(FileName, []).
-load(FileName, Opts) when list(FileName), list(Opts) ->
+load(FileName, Opts) when is_list(FileName), is_list(Opts) ->
Extension = file_extension(FileName),
Res = case ext_to_type(Extension) of
tga -> e3d__tga:load(FileName, Opts);
@@ -99,10 +99,10 @@ format_error(Other) ->
%% Func: convert(#e3d_image, NewType [,NewAlignment [,NewOrder ]])
%% Rets: #e3d_image | {error, Reason}
%% Desc: Converts an image to new type optionally NewAlignment and NewOrder
-convert(In, ToType) when atom(ToType) ->
+convert(In, ToType) when is_atom(ToType) ->
convert(In, ToType, In#e3d_image.alignment, In#e3d_image.order).
-convert(In, ToType, NewAlignment) when atom(ToType) ->
+convert(In, ToType, NewAlignment) when is_atom(ToType) ->
convert(In, ToType, NewAlignment, In#e3d_image.order).
convert(#e3d_image{type=Type, alignment=Al,order=O}=In, Type, Al, O) -> In;
View
@@ -702,7 +702,7 @@ make_percent(Percent0) when is_float(Percent0) ->
make_chunk(Tag, Contents) when is_binary(Contents) ->
Size = size(Contents) + 6,
[<<Tag:16/little,Size:32/little>>|Contents];
-make_chunk(Tag, Contents) when list(Contents) ->
+make_chunk(Tag, Contents) when is_list(Contents) ->
make_chunk(Tag, list_to_binary(Contents)).
%%%

0 comments on commit 9100400

Please sign in to comment.