[2824] in BarnOwl Developers
[PATCH] Punt owl_util_max and owl_util_min in favor of MAX and MIN
daemon@ATHENA.MIT.EDU (David Benjamin)
Wed Dec 15 14:02:51 2010
From: David Benjamin <davidben@MIT.EDU>
To: barnowl-dev@mit.edu
Date: Wed, 15 Dec 2010 14:02:22 -0500
glib already provides those macros which we happily use outside of one
place.
---
popwin.c | 4 ++--
util.c | 12 ------------
2 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/popwin.c b/popwin.c
index 6f8a256..218aae6 100644
--- a/popwin.c
+++ b/popwin.c
@@ -38,9 +38,9 @@ void owl_popwin_size_border(owl_window *parent, void *user_data)
owl_window_get_position(parent, &glines, &gcols, 0, 0);
- lines = owl_util_min(glines,24)*3/4 + owl_util_max(glines-24,0)/2;
+ lines = MIN(glines, 24) * 3/4 + MAX(glines - 24, 0) / 2;
startline = (glines-lines)/2;
- cols = owl_util_min(gcols,90)*15/16 + owl_util_max(gcols-90,0)/2;
+ cols = MIN(gcols, 90) * 15 / 16 + MAX(gcols - 90, 0) / 2;
startcol = (gcols-cols)/2;
owl_window_set_position(border, lines, cols, startline, startcol);
diff --git a/util.c b/util.c
index 4e0f352..d478ed1 100644
--- a/util.c
+++ b/util.c
@@ -454,18 +454,6 @@ int owl_util_file_deleteline(const char *filename, const char *line, int backup)
return numremoved;
}
-int owl_util_max(int a, int b)
-{
- if (a>b) return(a);
- return(b);
-}
-
-int owl_util_min(int a, int b)
-{
- if (a<b) return(a);
- return(b);
-}
-
/* Return the base class or instance from a zephyr class, by removing
leading `un' or trailing `.d'.
The caller is responsible for freeing the allocated string.
--
1.7.3.3.399.g06ddf