[hitori] core: Remove implicit dependency on libm through use of floor() function
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hitori] core: Remove implicit dependency on libm through use of floor() function
- Date: Sat, 24 Mar 2012 23:49:49 +0000 (UTC)
commit d8c5352767964f120af352b4fe98bf63bc171647
Author: Philip Withnall <philip tecnocode co uk>
Date: Sat Mar 24 23:29:03 2012 +0000
core: Remove implicit dependency on libm through use of floor() function
configure.ac | 1 -
src/interface.c | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 3daab95..574c87a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,7 +28,6 @@ IT_PROG_INTLTOOL([0.35.0])
GNOME_DOC_INIT
# Dependencies
-AC_CHECK_FUNCS([floor])
PKG_CHECK_MODULES([GENERAL],[glib-2.0 gtk+-3.0 gmodule-2.0 cairo >= 1.4])
# Output!
diff --git a/src/interface.c b/src/interface.c
index d9488fd..3122a15 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -270,8 +270,8 @@ hitori_button_release_cb (GtkWidget *drawing_area, GdkEventButton *event, Hitori
cell_size = width / hitori->board_size;
/* Determine the cell in which the button was released */
- pos.x = floor ((event->x - hitori->drawing_area_x_offset) / cell_size);
- pos.y = floor ((event->y - hitori->drawing_area_y_offset) / cell_size);
+ pos.x = (guchar) ((event->x - hitori->drawing_area_x_offset) / cell_size);
+ pos.y = (guchar) ((event->y - hitori->drawing_area_y_offset) / cell_size);
if (pos.x >= hitori->board_size || pos.y >= hitori->board_size)
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]