[Pidgin] #1344: fix for some build warnings

Pidgin trac at pidgin.im
Wed May 30 14:00:41 EDT 2007


#1344: fix for some build warnings
----------------------------+-----------------------------------------------
  Reporter:  o_sukhodolsky  |       Owner:  rlaager 
      Type:  patch          |      Status:  assigned
  Priority:  minor          |   Milestone:  2.0.2   
 Component:  pidgin (gtk)   |     Version:  2.0.1   
Resolution:                 |    Keywords:          
   Pending:  0              |  
----------------------------+-----------------------------------------------
Comment (by o_sukhodolsky):

 Replying to [comment:23 rlaager]:
 > Instead of using fopen(), fwrite(), & fclose() all over the place, would
 it make any sense to use purple_util_write_data_to_file() instead?

 as far as I can see there are a few places where you work with file
 locally (open/write or erad/close).  In most cases you open it in one
 place, read/write in another, and close in the third one.
 Anther issue I see is that there is no purple_util_read_data_from_file().
 and if you write a lot in the same file the performance will not be
 perfect (imho)

 And do not forget that there are several places where you use
 open()/close()/write()/read() with handlers.  And suggested change will
 not work for those places.

 > Speaking of which, excluding API/ABI concerns and compatibility with old
 versions of glib, could we replace purple_util_write_data_to_file() with
 g_file_set_contents()?

 as far as I can see g_file_set_contents() rewrites the file.  Is this what
 you want?

 But I agree that it would be nice to use the same API for (almost) all
 cases (not sure if it is doable though).  Grep shows that now you use
 open/g_open/fopen/g_fopen the same for close.

-- 
Ticket URL: <http://developer.pidgin.im/ticket/1344#comment:33>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list