Permalink
Browse files

fix compiler warnings

  • Loading branch information...
1 parent 89e1559 commit c971054ba8f310018085de338781b9a12b691d55 Emad El-Haraty committed Jul 1, 2010
Showing with 39 additions and 39 deletions.
  1. +5 −5 src/image_bmp.erl
  2. +2 −2 src/image_gif.erl
  3. +19 −19 src/image_jpeg.erl
  4. +6 −6 src/image_undef.erl
  5. +2 −2 src/mktab.erl
  6. +5 −5 src/video_mpeg.erl
View
@@ -42,8 +42,8 @@ extensions() -> [".bmp" ].
read_info(Fd) ->
case file:read(Fd, 54) of
- {ok, << ?BMP_HEADER(Size,Offset),
- ?BMP_INFO(_,Width,Height,Planes,BitCount,
+ {ok, << ?BMP_HEADER(_Size,_Offset),
+ ?BMP_INFO(_,Width,Height,Planes,_BitCount,
Compression,_,_,_,_,_) >> } ->
{ok, #erl_image { type = ?MODULE,
width = Width,
@@ -62,7 +62,7 @@ read_info(Fd) ->
end.
-write_info(Fd, IMG) ->
+write_info(_Fd, _IMG) ->
ok.
read(Fd, IMG, RowFun, St0) ->
@@ -82,7 +82,7 @@ read(Fd, IMG) ->
[]).
%% save image
-write(Fd, IMG) ->
+write(_Fd, _IMG) ->
ok.
%% Read all rows
@@ -95,7 +95,7 @@ read_pixels(Fd, IMG, RowFun, St0) ->
read_pixels(Fd, PIX, 0, Height, RowLength, RowFun, St0).
-read_pixels(Fd, PIX, NRows, NRows, BytesPerRow, RowFun, St) ->
+read_pixels(_Fd, PIX, NRows, NRows, _BytesPerRow, _RowFun, St) ->
{ok,PIX#erl_pixmap { pixels = St }};
read_pixels(Fd, PIX, Ri, NRows, BytesPerRow, RowFun, St) ->
case file:read(Fd, BytesPerRow) of
View
@@ -317,7 +317,7 @@ write(Fd, IMG) ->
Palette = IMG#erl_image.palette,
Background = attribute('Background',IMG#erl_image.attributes,0),
AspectRatio = attribute('AspectRatio', IMG#erl_image.attributes,0),
- if list(Palette) ->
+ if is_list(Palette) ->
PLen = length(Palette),
ColorRes = if PLen > 0, PLen =< 256 ->
trunc(math:log(PLen)/math:log(2))+1;
@@ -388,7 +388,7 @@ write_image(Fd, Pm) ->
Interlaced = attribute('Interlaced', Pm#erl_pixmap.attributes, 0),
%% Special code for none compressed data!!!
Inline = attribute('Inline', Pm#erl_pixmap.attributes, 0),
- if list(Palette) ->
+ if is_list(Palette) ->
PLen = length(Palette),
ColorRes = if PLen > 0, PLen =< 256 ->
trunc(math:log(PLen)/math:log(2))+1;
View
@@ -27,8 +27,8 @@
-magic(<<?M_SOI:16,?M_APP1:16,Len:16,"Exif",0,0,_/binary>>) -> true;
-magic(<<?M_SOI:16,?M_JFIF:16,Len:16,"JFIF",_,_,_/binary>>) -> true;
+magic(<<?M_SOI:16,?M_APP1:16,_Len:16,"Exif",0,0,_/binary>>) -> true;
+magic(<<?M_SOI:16,?M_JFIF:16,_Len:16,"JFIF",_,_,_/binary>>) -> true;
magic(_) -> false.
mime_type() -> "image/jpeg".
@@ -48,17 +48,17 @@ read_info(Fd) ->
Error -> Error
end.
-write_info(Fd, _IMG) ->
+write_info(_Fd, _IMG) ->
ok.
read(_Fd,IMG) ->
{ok,IMG}.
-read(_Fd,IMG,RowFun,St0) ->
+read(_Fd,IMG,_RowFun,_St0) ->
{ok,IMG}.
-write(_Fd,IMG) ->
+write(_Fd,_IMG) ->
ok.
@@ -115,44 +115,44 @@ read_section(Fd,Marker,Len,IMG) ->
read_sections(Fd, IMG)
end.
-process_sofn(<<Depth:8,Height:16,Width:16,_Components:8,Bin/binary>>, IMG) ->
+process_sofn(<<Depth:8,Height:16,Width:16,_Components:8,_Bin/binary>>, IMG) ->
IMG#erl_image { depth = Depth,
height = Height,
width = Width }.
%% Maker OLYMP
collect_olymp(_Fd, T, St) ->
- Key = erl_img:hex16(T#tiff_entry.tag),
+ _Key = erl_img:hex16(T#tiff_entry.tag),
?dbg("OLYMP(~s) ~p ~p ~p\n",
- [T#tiff_entry.ifd,Key,T#tiff_entry.type, T#tiff_entry.value]),
+ [T#tiff_entry.ifd,_Key,T#tiff_entry.type, T#tiff_entry.value]),
St.
%% Maker Nikon
collect_nikon(_Fd, T, St) ->
- Key = erl_img:hex16(T#tiff_entry.tag),
+ _Key = erl_img:hex16(T#tiff_entry.tag),
?dbg("Nikon(~s) ~p ~p ~p\n",
- [T#tiff_entry.ifd,Key,T#tiff_entry.type, T#tiff_entry.value]),
+ [T#tiff_entry.ifd,_Key,T#tiff_entry.type, T#tiff_entry.value]),
St.
%% Maker FUJIFILM
collect_fujifilm(_Fd, T, St) ->
- Key = erl_img:hex16(T#tiff_entry.tag),
+ _Key = erl_img:hex16(T#tiff_entry.tag),
?dbg("Fujifilm(~s) ~p ~p ~p\n",
- [T#tiff_entry.ifd,Key,T#tiff_entry.type, T#tiff_entry.value]),
+ [T#tiff_entry.ifd,_Key,T#tiff_entry.type, T#tiff_entry.value]),
St.
%% Maker Sony DSC
collect_sony(_Fd, T, St) ->
- Key = erl_img:hex16(T#tiff_entry.tag),
+ _Key = erl_img:hex16(T#tiff_entry.tag),
?dbg("Sony(~s) ~p ~p ~p\n",
- [T#tiff_entry.ifd,Key,T#tiff_entry.type, T#tiff_entry.value]),
- St.
+ [T#tiff_entry.ifd,_Key,T#tiff_entry.type, T#tiff_entry.value]),
+ St.
%% Maker other
collect_other(_Fd, T, St) ->
- Key = erl_img:hex16(T#tiff_entry.tag),
+ _Key = erl_img:hex16(T#tiff_entry.tag),
?dbg("Maker(~s) ~p ~p ~p\n",
- [T#tiff_entry.ifd,Key,T#tiff_entry.type, T#tiff_entry.value]),
+ [T#tiff_entry.ifd,_Key,T#tiff_entry.type, T#tiff_entry.value]),
St.
collect_maker(_Fd, T, St) ->
@@ -196,9 +196,9 @@ collect_maker_fixme(Fd, T, St) ->
collect_exif(Fd, T, St) ->
- Key = exif:decode_tag(T#tiff_entry.tag),
+ _Key = exif:decode_tag(T#tiff_entry.tag),
?dbg("EXIF(~s) ~p ~p ~p\n",
- [T#tiff_entry.ifd,Key,T#tiff_entry.type, T#tiff_entry.value]),
+ [T#tiff_entry.ifd,_Key,T#tiff_entry.type, T#tiff_entry.value]),
case T#tiff_entry.tag of
?ExifInteroperabilityOffset ->
[Offset] = T#tiff_entry.value,
View
@@ -6,7 +6,7 @@
-module(image_undef).
-include_lib("erl_img/include/erl_img.hrl").
--inlcude("api.hrl").
+-include("api.hrl").
magic(_) -> false.
@@ -15,19 +15,19 @@ mime_type() -> "".
extensions() -> [].
-read_info(Fd) ->
+read_info(_Fd) ->
{error, bad_magic}.
-write_info(Fd, IMG) ->
+write_info(_Fd, _IMG) ->
{error, bad_image}.
-read(Fd,IMG) ->
+read(_Fd,_IMG) ->
{error, bad_image}.
-read(Fd,IMG,PixFun,PixSt) ->
+read(_Fd,_IMG,_PixFun,_PixSt) ->
{error, bad_image}.
-write(Fd,IMG) ->
+write(_Fd,_IMG) ->
{error, bad_image}.
View
@@ -17,7 +17,7 @@ nib(N) -> (N-10)+$A.
bin(N) ->
bin(N,8,[]).
-bin(N, 0, Acc) ->
+bin(_N, 0, Acc) ->
[$2,$#|Acc];
bin(N, I, Acc) ->
bin(N bsr 1, I-1, [$0+(N band 1) | Acc]).
@@ -26,7 +26,7 @@ bin(N, I, Acc) ->
revbits(N) ->
revbits(N,8,0).
-revbits(N,0,A) ->
+revbits(_N,0,A) ->
A;
revbits(N,I,A) ->
revbits(N bsr 1,I-1,(A bsl 1) bor (N band 1)).
View
@@ -14,20 +14,20 @@ mime_type() -> "video/mpeg".
extensions() -> [".mpg", ".mpeg"].
-read_info(Fd) ->
+read_info(_Fd) ->
{error, bad_magic}.
-write_info(Fd, IMG) ->
+write_info(_Fd, _IMG) ->
{error, bad_image}.
-read(Fd,IMG) ->
+read(_Fd,_IMG) ->
{error, bad_image}.
-read(Fd,IMG,PixFun,PixSt) ->
+read(_Fd,_IMG,_PixFun,_PixSt) ->
{error, bad_image}.
-write(Fd,IMG) ->
+write(_Fd,_IMG) ->
{error, bad_image}.

0 comments on commit c971054

Please sign in to comment.