Re: Fixed some compiler warnings - Mailing list pgadmin-hackers

From Akshay Joshi
Subject Re: Fixed some compiler warnings
Date
Msg-id CANxoLDf=fWJ3DHE7eEtNKY53O3qgBfQ+0fUL5Lkt6n_4h=8NTQ@mail.gmail.com
Whole thread Raw
In response to Re: Fixed some compiler warnings  (Ashesh Vashi <ashesh.vashi@enterprisedb.com>)
Responses Re: Fixed some compiler warnings  (Dave Page <dpage@pgadmin.org>)
List pgadmin-hackers
Thanks Ashesh,


On Mon, Feb 3, 2014 at 11:49 AM, Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
Akshay,

wxGetSingleChoiceIndex returns integer not "unsigned integer"
And, this syntax is definitely wrong in any case for unsigned integers

   Fixed the above by changing the data type from "unsigned int" to "int", but for the other cases in the patch where I have applied the logic
   like if (i > 0 || i==0) to fix compiler warnings, we have already discussed the same solution on Friday.

   Attached is the modified patch.  

if (i > 0 || i == 0)


On Mon, Feb 3, 2014 at 11:34 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:



On Fri, Jan 31, 2014 at 7:26 PM, Dave Page <dpage@pgadmin.org> wrote:



On Fri, Jan 31, 2014 at 6:03 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:



On Thu, Jan 30, 2014 at 7:35 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi


On Thu, Jan 30, 2014 at 9:35 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Dave 

I have fixed some compiler warnings which we are facing on OSX Mavericks. Attached is the patch file. Can you please review it.

If patch looks good to you then can you please commit it.


It mostly looks good, but what's with the operator changes? Why is it complaining about x >= 0 ? 

   In all such cases x is unsigned int and compiler complaining about condition "x >=0" will always true.  

 Ahh yes. However, the proposed fix will always evaluate to true won't it?

if (i > 0 || i == 0)
{

}

   Yes it will, but in this case compiler didn't generate any warning.  

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



--
Akshay Joshi
Principal Software Engineer 


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246



--
--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA:
Enterprise PostgreSQL Company

 

http://www.linkedin.com/in/asheshvashi




--
Akshay Joshi
Principal Software Engineer 


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Attachment

pgadmin-hackers by date:

Previous
From: Ashesh Vashi
Date:
Subject: Re: Fixed some compiler warnings
Next
From: Dave Page
Date:
Subject: Re: Fixed some compiler warnings