Commit 8f4e8193 authored by IOhannes m zmölnig's avatar IOhannes m zmölnig
Browse files

do unsigned comparision <1, rather than <=0

less warnings...
parent 5996d729
......@@ -123,12 +123,12 @@ void gemglfw2window :: titleMess(std::string s)
/////////////////////////////////////////////////////////
void gemglfw2window :: dimensionsMess(unsigned int width, unsigned int height)
{
if (width <= 0) {
if (width < 1) {
error("width must be greater than 0");
return;
}
if (height <= 0 ) {
if (height < 1) {
error ("height must be greater than 0");
return;
}
......
......@@ -130,12 +130,12 @@ void gemglfw3window :: titleMess(std::string s)
/////////////////////////////////////////////////////////
void gemglfw3window :: dimensionsMess(unsigned int width, unsigned int height)
{
if (width <= 0) {
if (width < 1) {
error("width must be greater than 0");
return;
}
if (height <= 0 ) {
if (height < 1) {
error ("height must be greater than 0");
return;
}
......
......@@ -253,12 +253,12 @@ void gemglutwindow :: titleMess(std::string s)
/////////////////////////////////////////////////////////
void gemglutwindow :: dimensionsMess(unsigned int width, unsigned int height)
{
if (width <= 0) {
if (width < 1) {
error("width must be greater than 0");
return;
}
if (height <= 0 ) {
if (height < 1 ) {
error ("height must be greater than 0");
return;
}
......@@ -318,6 +318,7 @@ bool gemglutwindow :: create(void)
if(s_windowmap.size()>0) {
std::map<int,gemglutwindow*>::iterator it = s_windowmap.begin();
gemglutwindow*other=NULL;
// FIXXME: shouldn't we iterate over all the windows?
other=it->second;
if(other && other->makeCurrent()) {
glutSetOption(GLUT_RENDERING_CONTEXT, GLUT_USE_CURRENT_CONTEXT );
......
......@@ -824,12 +824,12 @@ void gemglxwindow :: titleMess(std::string s)
/////////////////////////////////////////////////////////
void gemglxwindow :: dimensionsMess(unsigned int width, unsigned int height)
{
if (width <= 0) {
if (width < 1) {
error("width must be greater than 0");
return;
}
if (height <= 0 ) {
if (height < 1) {
error ("height must be greater than 0");
return;
}
......@@ -974,6 +974,9 @@ void gemglxwindow :: destroy(void)
XFlush( m_pimpl->dpy );
err=XCloseDisplay(m_pimpl->dpy); /* this crashes if no window is there */
if(err) {
verbose(1, "XCloseDisplay returned %d", err);
}
}
m_pimpl->dpy = NULL;
m_pimpl->win = 0;
......
......@@ -1545,11 +1545,11 @@ void gemmacwindow :: destroyMess(void) {
void gemmacwindow :: dimensionsMess(unsigned int width, unsigned int height)
{
if (width <= 0) {
if (width < 1) {
error("width must be greater than 0");
return;
}
if (height <= 0 ) {
if (height < 1) {
error ("height must be greater than 0");
return;
}
......
......@@ -454,12 +454,12 @@ void gemsdlwindow :: titleMess(std::string s)
/////////////////////////////////////////////////////////
void gemsdlwindow :: dimensionsMess(unsigned int width, unsigned int height)
{
if (width <= 0) {
if (width < 1) {
error("width must be greater than 0");
return;
}
if (height <= 0 ) {
if (height < 1) {
error ("height must be greater than 0");
return;
}
......
......@@ -461,12 +461,12 @@ void gemw32window::topmostMess(bool state)
/////////////////////////////////////////////////////////
void gemw32window :: dimensionsMess(unsigned int width, unsigned int height)
{
if (width <= 0) {
if (width < 1) {
error("width must be greater than 0");
return;
}
if (height <= 0 ) {
if (height < 1) {
error ("height must be greater than 0");
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment