diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-05-17 14:18:09 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-05-17 14:18:09 +0200 |
commit | bcf2da2389d1df99629ae524a4cc451bdf6224ae (patch) | |
tree | ac7e944620a158b66c6ff33fd5da5855127f2f2b /lib/percept/src/egd.erl | |
parent | 4690966ae8cf72b0466e3c1bbe9911ca0ea9ea74 (diff) | |
download | otp-bcf2da2389d1df99629ae524a4cc451bdf6224ae.tar.gz otp-bcf2da2389d1df99629ae524a4cc451bdf6224ae.tar.bz2 otp-bcf2da2389d1df99629ae524a4cc451bdf6224ae.zip |
egd: Fix unmatched return warnings
Diffstat (limited to 'lib/percept/src/egd.erl')
-rw-r--r-- | lib/percept/src/egd.erl | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/lib/percept/src/egd.erl b/lib/percept/src/egd.erl index b5160640af..fe52da71f1 100644 --- a/lib/percept/src/egd.erl +++ b/lib/percept/src/egd.erl @@ -70,8 +70,7 @@ create(Width,Height) -> -spec destroy(Image :: egd_image()) -> ok. destroy(Image) -> - cast(Image, destroy), - ok. + cast(Image, destroy). %% @spec render(egd_image()) -> binary() @@ -109,8 +108,7 @@ render(Image, Type, Options) -> %% mainly. information(Pid) -> - cast(Pid, information), - ok. + cast(Pid, information). %% @spec line(egd_image(), point(), point(), color()) -> ok %% @doc Creates a line object from P1 to P2 in the image. @@ -122,8 +120,7 @@ information(Pid) -> Color :: color()) -> 'ok'. line(Image, P1, P2, Color) -> - cast(Image, {line, P1, P2, Color}), - ok. + cast(Image, {line, P1, P2, Color}). %% @spec color( Value | Name ) -> color() %% where @@ -148,74 +145,67 @@ color(_Image, Color) -> %% @doc Creates a text object. text(Image, P, Font, Text, Color) -> - cast(Image, {text, P, Font, Text, Color}), - ok. + cast(Image, {text, P, Font, Text, Color}). %% @spec rectangle(egd_image(), point(), point(), color()) -> ok %% @doc Creates a rectangle object. rectangle(Image, P1, P2, Color) -> - cast(Image, {rectangle, P1, P2, Color}), - ok. + cast(Image, {rectangle, P1, P2, Color}). %% @spec filledRectangle(egd_image(), point(), point(), color()) -> ok %% @doc Creates a filled rectangle object. filledRectangle(Image, P1, P2, Color) -> - cast(Image, {filled_rectangle, P1, P2, Color}), - ok. + cast(Image, {filled_rectangle, P1, P2, Color}). %% @spec filledEllipse(egd_image(), point(), point(), color()) -> ok %% @doc Creates a filled ellipse object. filledEllipse(Image, P1, P2, Color) -> - cast(Image, {filled_ellipse, P1, P2, Color}), - ok. + cast(Image, {filled_ellipse, P1, P2, Color}). %% @spec filledTriangle(egd_image(), point(), point(), point(), color()) -> ok %% @hidden %% @doc Creates a filled triangle object. filledTriangle(Image, P1, P2, P3, Color) -> - cast(Image, {filled_triangle, P1, P2, P3, Color}), - ok. + cast(Image, {filled_triangle, P1, P2, P3, Color}). %% @spec polygon(egd_image(), [point()], color()) -> ok %% @hidden %% @doc Creates a filled filled polygon object. polygon(Image, Pts, Color) -> - cast(Image, {polygon, Pts, Color}), - ok. + cast(Image, {polygon, Pts, Color}). %% @spec arc(egd_image(), point(), point(), color()) -> ok %% @hidden %% @doc Creates an arc with radius of bbx corner. arc(Image, P1, P2, Color) -> - cast(Image, {arc, P1, P2, Color}), - ok. + cast(Image, {arc, P1, P2, Color}). %% @spec arc(egd_image(), point(), point(), integer(), color()) -> ok %% @hidden %% @doc Creates an arc. arc(Image, P1, P2, D, Color) -> - cast(Image, {arc, P1, P2, D, Color}), - ok. + cast(Image, {arc, P1, P2, D, Color}). %% @spec save(binary(), string()) -> ok %% @doc Saves the binary to file. save(Binary, Filename) when is_binary(Binary) -> - file:write_file(Filename, Binary), + ok = file:write_file(Filename, Binary), ok. % --------------------------------- % Aux functions % --------------------------------- cast(Pid, Command) -> - Pid ! {egd, self(), Command}. + Pid ! {egd, self(), Command}, + ok. call(Pid, Command) -> Pid ! {egd, self(), Command}, |