]> granicus.if.org Git - transmission/commitdiff
reverse patch #6948. one of the new gcc attributes seems to be causing trouble.
authorCharles Kerr <charles@transmissionbt.com>
Thu, 23 Oct 2008 02:37:21 +0000 (02:37 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Thu, 23 Oct 2008 02:37:21 +0000 (02:37 +0000)
gtk/actions.c
libtransmission/Makefile.am
libtransmission/blocklist.h
libtransmission/handshake.h
libtransmission/peer-io.h
libtransmission/peer-mgr.h
libtransmission/session.h
libtransmission/tr-gnuc.h
libtransmission/transmission.h
libtransmission/utils.h

index a7fafdc44f7bf0afaef8a28341cf7a6d6615c8e9..a0a4b72f0bb2dd4cab44a6cc88cbd4c0ba9b38fb 100644 (file)
@@ -21,6 +21,8 @@
 #include "lock.h"
 #include "logo.h"
 
+#define UNUSED G_GNUC_UNUSED
+
 static TrCore *         myCore = NULL;
 
 static GtkActionGroup * myGroup = NULL;
index c257c75f0d02cb720d08397ee595793844146992..bc3a3ce0085491e8dc2874c59d7dd0f221925dd8 100644 (file)
@@ -88,7 +88,6 @@ noinst_HEADERS = \
     torrent.h \
     tracker.h \
     tr-getopt.h \
-    tr-gnuc.h \
     transmission.h \
     trevent.h \
     upnp.h \
index 1c4a9a38b5c5ebe72ad9403d276523e515df5b88..7b285b34d4daed8a54fb092fd709f3f58a2fa52e 100644 (file)
 #ifndef TR_BLOCKLIST_H
 #define TR_BLOCKLIST_H
 
-#include "tr-gnuc.h"
-
 struct in_addr;
 typedef struct tr_blocklist tr_blocklist;
 
 tr_blocklist* _tr_blocklistNew( const char * filename,
-                                int          isEnabled ) TR_GNUC_MALLOC;
+                                int          isEnabled );
 
-int           _tr_blocklistExists      ( const tr_blocklist    * blocklist );
+int           _tr_blocklistExists( const tr_blocklist * );
 
-const char*   _tr_blocklistGetFilename ( const tr_blocklist    * blocklist );
+const char*   _tr_blocklistGetFilename( const tr_blocklist * );
 
-int           _tr_blocklistGetRuleCount( const tr_blocklist    * blocklist );
+int           _tr_blocklistGetRuleCount( const tr_blocklist * );
 
-void          _tr_blocklistFree        ( tr_blocklist          * blocklist );
+void          _tr_blocklistFree( tr_blocklist * );
 
-int           _tr_blocklistIsEnabled   ( tr_blocklist          * blocklist );
+int           _tr_blocklistIsEnabled( tr_blocklist * );
 
-void          _tr_blocklistSetEnabled  ( tr_blocklist          * blocklist,
-                                         int                     isEnabled );
+void          _tr_blocklistSetEnabled(             tr_blocklist *,
+                                               int isEnabled );
 
-int           _tr_blocklistHasAddress  ( tr_blocklist          * blocklist,
-                                         const struct in_addr  * addr );
+int           _tr_blocklistHasAddress(
+              tr_blocklist *,
+    const struct
+    in_addr * addr );
 
-int           _tr_blocklistSetContent  ( tr_blocklist          * blocklist,
-                                         const char            * filename );
+int           _tr_blocklistSetContent(
+                 tr_blocklist *,
+    const char * filename );
 
 #endif
index f1d8f8a1fd083d779e4de09c8bf2c4dd2b27407d..9f9c529aaac27812af0b509359ef81284bd5b5f9 100644 (file)
@@ -29,12 +29,12 @@ typedef int ( *handshakeDoneCB )( struct tr_handshake * handshake,
 tr_handshake *         tr_handshakeNew( struct tr_peerIo * io,
                                         tr_encryption_mode encryptionMode,
                                         handshakeDoneCB    doneCB,
-                                        void *             doneUserData )
-                                                                TR_GNUC_MALLOC;
+                                        void *             doneUserData );
 
 const struct in_addr * tr_handshakeGetAddr(
-                                        const struct tr_handshake * handshake,
-                                        uint16_t                  * setme_port );
+    const struct tr_handshake * handshake,
+                                uint16_t
+    *                           setme_port );
 
 void                   tr_handshakeAbort( tr_handshake * handshake );
 
index ca56f69fcfc3d98c0004de6b3b13c7afca73b06b..e04069aec0531bf24bd4eb409cab3a339c63fba5 100644 (file)
@@ -17,8 +17,6 @@
 ***
 **/
 
-#include "tr-gnuc.h"
-
 struct in_addr;
 struct evbuffer;
 struct bufferevent;
@@ -30,17 +28,17 @@ typedef struct tr_peerIo tr_peerIo;
 ***
 **/
 
-tr_peerIo*  tr_peerIoNewOutgoing( struct tr_handle *     session,
-                                  const struct in_addr * addr,
-                                  int                    port,
-                                  const  uint8_t       * torrentHash )
-                                                                TR_GNUC_MALLOC;
+tr_peerIo*           tr_peerIoNewOutgoing(
+    struct tr_handle *     session,
+    const struct in_addr * addr,
+    int                    port,
+    const  uint8_t *
+                           torrentHash );
 
-tr_peerIo*  tr_peerIoNewIncoming( struct tr_handle *     session,
-                                  const struct in_addr * addr,
-                                  uint16_t               port,
-                                  int                    socket ) 
-                                                                TR_GNUC_MALLOC;
+tr_peerIo*           tr_peerIoNewIncoming( struct tr_handle *     session,
+                                           const struct in_addr * addr,
+                                           uint16_t               port,
+                                           int                    socket );
 
 void                 tr_peerIoFree( tr_peerIo * io );
 
@@ -70,13 +68,13 @@ const char*          tr_peerIoAddrStr( const struct in_addr * addr,
 const char*          tr_peerIoGetAddrStr( const tr_peerIo * io );
 
 const struct in_addr*tr_peerIoGetAddress( const tr_peerIo * io,
-                                          uint16_t        * port );
+                                                uint16_t * port );
 
 const uint8_t*       tr_peerIoGetTorrentHash( tr_peerIo * io );
 
 int                  tr_peerIoHasTorrentHash( const tr_peerIo * io );
 
-void                 tr_peerIoSetTorrentHash( tr_peerIo     * io,
+void                 tr_peerIoSetTorrentHash( tr_peerIo *     io,
                                               const uint8_t * hash );
 
 int                  tr_peerIoReconnect( tr_peerIo * io );
@@ -123,6 +121,11 @@ void              tr_peerIoSetIOFuncs( tr_peerIo *     io,
 int               tr_peerIoWantsBandwidth( const tr_peerIo * io,
                                                              tr_direction );
 
+#if 0
+void              tr_peerIoTryRead( tr_peerIo * io );
+
+#endif
+
 void              tr_peerIoWrite( tr_peerIo *  io,
                                   const void * writeme,
                                   size_t       writemeLen );
index 154d4302778c4d6fbb81c236b761309c12a7ad7c..9ef34639d764ad8e2075bdb420143afeaf43201d 100644 (file)
 
 #include <inttypes.h> /* uint16_t */
 
-#include "net.h" /* struct in_addr */
-#include "tr-gnuc.h"
+#ifdef WIN32
+ #include <winsock2.h> /* struct in_addr */
+#else
+ #include <netinet/in.h> /* struct in_addr */
+#endif
 
 struct in_addr;
 struct tr_handle;
@@ -43,7 +46,7 @@ tr_pex;
 
 int tr_pexCompare( const void * a, const void * b );
 
-tr_peerMgr* tr_peerMgrNew( struct tr_handle * ) TR_GNUC_MALLOC;
+tr_peerMgr* tr_peerMgrNew( struct tr_handle * );
 
 void tr_peerMgrFree( tr_peerMgr * manager );
 
index 7bd0a7dd98433b51924b51e185f878d8dd61e124..18cd0d8f77b11fb8465c185fc39649adf359ab64 100644 (file)
 
 #define TR_NAME "Transmission"
 
-#include "tr-gnuc.h"
+#ifndef UNUSED
+ #ifdef __GNUC__
+  #define UNUSED __attribute__ ( ( unused ) )
+ #else
+  #define UNUSED
+ #endif
+#endif
 
 enum
 {
@@ -41,7 +47,7 @@ enum
 
 typedef enum { TR_NET_OK, TR_NET_ERROR, TR_NET_WAIT } tr_tristate_t;
 
-uint8_t*       tr_peerIdNew( void ) TR_GNUC_MALLOC;
+uint8_t*       tr_peerIdNew( void );
 
 const uint8_t* tr_getPeerId( void );
 
index a7cbf64365dd66d393dfb7a01ce461a727885477..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,40 +0,0 @@
-#ifndef TR_GNUC_H
-#define TR_GNUC_H 1
-
-#ifndef UNUSED
- #ifdef __GNUC__
-  #define UNUSED __attribute__ ( ( unused ) )
- #else
-  #define UNUSED
- #endif
-#endif
-
-#ifndef TR_GNUC_PRINTF
- #ifdef __GNUC__
-  #define TR_GNUC_PRINTF( fmt,\
-                          args ) __attribute__ ( ( format ( printf, fmt,\
-                                                            args ) ) )
- #else
-  #define TR_GNUC_PRINTF( fmt, args )
- #endif
-#endif
-
-#ifndef TR_GNUC_NULL_TERMINATED
- #if __GNUC__ >= 4
-  #define TR_GNUC_NULL_TERMINATED __attribute__ ( ( __sentinel__ ) )
- #else
-  #define TR_GNUC_NULL_TERMINATED
- #endif
-#endif
-
-#if __GNUC__ > 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 96 )
- #define TR_GNUC_CONST __attribute__ ( ( __const ) )
- #define TR_GNUC_PURE __attribute__ ( ( __pure__ ) )
- #define TR_GNUC_MALLOC __attribute__ ( ( __malloc__ ) )
-#else
- #define TR_GNUC_CONST
- #define TR_GNUC_PURE
- #define TR_GNUC_MALLOC
-#endif
-
-#endif
index c118b9c8f0a2d06da5cd1b86c35ee274fa30c68f..91c620fac758c0098c1f5526893ae5c91f77ea08 100644 (file)
@@ -36,7 +36,6 @@
 extern "C" {
 #endif
 
-#include "tr-gnuc.h"
 #include "version.h"
 
 #include <inttypes.h> /* uintN_t */
@@ -728,7 +727,7 @@ tr_ctorMode;
 
 struct tr_benc;
 
-tr_ctor*    tr_ctorNew( const tr_handle * handle ) TR_GNUC_MALLOC;
+tr_ctor*    tr_ctorNew( const tr_handle * handle );
 
 void        tr_ctorFree( tr_ctor * ctor );
 
@@ -810,7 +809,7 @@ int          tr_torrentParse( const tr_handle * handle,
             TR_EDUPLICATE if there's already a matching torrent object. */
 tr_torrent * tr_torrentNew( tr_handle *     handle,
                             const tr_ctor * ctor,
-                            int *           setmeError ) TR_GNUC_MALLOC;
+                            int *           setmeError );
 
 /** @} */
 
index 2fa9a0a17e2c175c2a72df0fe76f99d4830c2f12..f5dfae3df02965abb1c481a3e172938ec902180b 100644 (file)
@@ -47,7 +47,40 @@ extern "C" {
  #define TRUE 1
 #endif
 
-#include "tr-gnuc.h"
+#ifndef UNUSED
+ #ifdef __GNUC__
+  #define UNUSED __attribute__ ( ( unused ) )
+ #else
+  #define UNUSED
+ #endif
+#endif
+
+#ifndef TR_GNUC_PRINTF
+ #ifdef __GNUC__
+  #define TR_GNUC_PRINTF( fmt,\
+                          args ) __attribute__ ( ( format ( printf, fmt,\
+                                                            args ) ) )
+ #else
+  #define TR_GNUC_PRINTF( fmt, args )
+ #endif
+#endif
+
+#ifndef TR_GNUC_NULL_TERMINATED
+ #if __GNUC__ >= 4
+  #define TR_GNUC_NULL_TERMINATED __attribute__ ( ( __sentinel__ ) )
+ #else
+  #define TR_GNUC_NULL_TERMINATED
+ #endif
+#endif
+
+#if __GNUC__ > 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 96 )
+ #define TR_GNUC_PURE __attribute__ ( ( __pure__ ) )
+ #define TR_GNUC_MALLOC __attribute__ ( ( __malloc__ ) )
+#else
+ #define TR_GNUC_PURE
+ #define TR_GNUC_MALLOC
+#endif
+
 
 /***
 ****
@@ -159,10 +192,10 @@ void tr_timevalMsec( uint64_t           milliseconds,
 
 
 /* return the current date in milliseconds */
-uint64_t       tr_date( void ) TR_GNUC_CONST;
+uint64_t       tr_date( void );
 
 /* wait the specified number of milliseconds */
-void           tr_wait( uint64_t delay_milliseconds ) TR_GNUC_CONST;
+void           tr_wait( uint64_t delay_milliseconds );
 
 /***
 ****
@@ -229,7 +262,7 @@ int         tr_snprintf( char *       buf,
                          const char * fmt,
                          ... ) TR_GNUC_PRINTF( 3, 4 );
 
-const char* tr_strerror( int ) TR_GNUC_CONST;
+const char* tr_strerror( int );
 
 char*       tr_strstrip( char * str );
 
@@ -326,7 +359,7 @@ tr_bitfield* tr_bitfieldOr(                               tr_bitfield*,
     && tr_bitfieldHasFast( bitfield, nth ) )
 
 double tr_getRatio( double numerator,
-                    double denominator ) TR_GNUC_CONST;
+                    double denominator );
 
 #ifdef __cplusplus
 }