]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3720: SourceLayout: shuffle fd_table definition into fde.h
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 26 Feb 2013 22:21:22 +0000 (15:21 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 26 Feb 2013 22:21:22 +0000 (15:21 -0700)
Shift the definition out of globals.h into fde.h where the type class
is defined, and the instance into fde.cc. Fixing bug 3720; build errors
on OpenIndiana and Solaris.

Also, move it into the fde class scope as a static Table member.
Provides wrapper definition of fd_table to reduce patch impact.

src/Makefile.am
src/fde.cc
src/fde.h
src/globals.h
src/tests/stub_fd.cc

index 803c430db809f56bb725160a16715ebaa2d5cce3..8e9309ee2d9cd46b4966d155abbca4ef6da1857c 100644 (file)
@@ -1628,6 +1628,8 @@ tests_testDiskIO_SOURCES = \
        tests/stub_fatal.cc \
        fd.h \
        fd.cc \
+       fde.h \
+       fde.cc \
        FileMap.h \
        filemap.cc \
        HttpBody.h \
@@ -2868,6 +2870,7 @@ tests_testStore_SOURCES= \
        tests/stub_DiskIOModule.cc \
        tests/stub_errorpage.cc \
        fd.h \
+       fde.h \
        tests/stub_fd.cc \
        tests/stub_helper.cc \
        tests/stub_HelperChildConfig.cc \
@@ -3026,6 +3029,8 @@ tests_testUfs_SOURCES = \
        tests/stub_fatal.cc \
        fd.h \
        fd.cc \
+       fde.h \
+       fde.cc \
        client_db.h \
        disk.h \
        disk.cc \
@@ -3189,6 +3194,8 @@ tests_testRock_SOURCES = \
        tests/stub_fatal.cc \
        fd.h \
        fd.cc \
+       fde.h \
+       fde.cc \
        FileMap.h \
        filemap.cc \
        HttpHeaderFieldStat.h \
@@ -3349,6 +3356,8 @@ tests_testCoss_SOURCES = \
        tests/stub_fatal.cc \
        fd.h \
        fd.cc \
+       fde.h \
+       fde.cc \
        disk.h \
        disk.cc \
        FileMap.h \
index 8aae9767f5148774f7ae54ca19897865134fc46f..c690c415dc10c7748f4a44dec0a1d1daa4649612 100644 (file)
@@ -38,6 +38,8 @@
 #include "SquidTime.h"
 #include "Store.h"
 
+fde *fde::Table = NULL;
+
 bool
 fde::readPending(int fdNumber)
 {
index f82e190901e4faa5f793fe57ee1a0088d8525d34..680cea615b509b54bd51e82ea59bd7af5be6a8b2 100644 (file)
--- a/src/fde.h
+++ b/src/fde.h
@@ -73,6 +73,10 @@ public:
     void noteUse(PconnPool *);
 
 public:
+
+    /// global table of FD and their state.
+    static fde* Table;
+
     unsigned int type;
     unsigned short remote_port;
 
@@ -193,6 +197,8 @@ private:
     }
 };
 
+#define fd_table fde::Table
+
 int fdNFree(void);
 
 #define FD_READ_METHOD(fd, buf, len) (*fd_table[fd].read_method)(fd, buf, len)
index 3980d926d880a0c895b0cc0b725f55d4582f7b54..cc640597ab05552eddec0c57e4b633cd2ea84ba4 100644 (file)
@@ -60,8 +60,6 @@ extern const char *memStatusStr[];
 extern const char *pingStatusStr[];
 extern const char *storeStatusStr[];
 extern const char *swapStatusStr[];
-class fde;
-extern fde *fd_table;          /* NULL */
 extern int Biggest_FD;         /* -1 */
 extern int Number_FD;          /* 0 */
 extern int Opening_FD;         /* 0 */
index a5eab4b03f3440867df6bc6ba0cb6b97e7c1d53d..1c6f0efdf016e56f03dde89d71cf593fc5fcd126 100644 (file)
@@ -4,6 +4,8 @@
 #define STUB_API "fd.cc"
 #include "tests/STUB.h"
 
+fde *fde::Table = NULL;
+
 int fdNFree(void) STUB_RETVAL(-1)
 void fd_open(int fd, unsigned int type, const char *desc) STUB
 void fd_close(int fd) STUB