]> Dogcows Code - chaz/openbox/blobdiff - otk/size.hh
apparently my variable names were too verbose.
[chaz/openbox] / otk / size.hh
index 915396142bd19a5c42e2694dbf8820c3f3bfd269..57447d5dc45b8200e1c586b6f8233c373d5cab34 100644 (file)
@@ -2,17 +2,19 @@
 #ifndef __size_hh
 #define __size_hh
 
+#include <cassert>
+
 namespace otk {
 
 class Size {
-  unsigned int _w, _h;
+  int _w, _h;
 public:
   Size() : _w(1), _h(1) {}
-  Size(unsigned int w, unsigned int h) : _w(w), _h(h) {}
-  Size(const Size &s) : _w(s._w), _h(s._h) {}
+  Size(int w, int h) : _w(w), _h(h) { assert(_w >= 0 && _h >= 0); }
+  Size(const Size &s) : _w(s._w), _h(s._h) { assert(_w >= 0 && _h >= 0); }
 
-  inline unsigned int width() const { return _w; }
-  inline unsigned int height() const { return _h; }
+  inline int width() const { return _w; }
+  inline int height() const { return _h; }
 
   bool operator==(const Size &o) const { return _w == o._w && _h == o._h; }
   bool operator!=(const Size &o) const { return _w != o._w || _h != o._h; }
This page took 0.022689 seconds and 4 git commands to generate.