[PATCH:xscope 12/14] File descriptors should be stored in ints not shorts
Alan Coopersmith
alan.coopersmith at ORACLE.COM
Sat Sep 24 08:48:30 PDT 2011
All OS routines take and return ints for file descriptors, so stop
converting back and forth to shorts.
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
fd.c | 2 +-
fd.h | 6 +++---
scope.c | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/fd.c b/fd.c
index be42d4b..8f824d6 100644
--- a/fd.c
+++ b/fd.c
@@ -84,7 +84,7 @@
void
InitializeFD(void)
{
- register short i;
+ int i;
enterprocedure("InitializeFD");
/* get the number of file descriptors the system will let us use */
diff --git a/fd.h b/fd.h
index 605375a..005e62d 100644
--- a/fd.h
+++ b/fd.h
@@ -78,14 +78,14 @@ struct FDDescriptor
};
extern struct FDDescriptor *FDD /* array of FD descriptors */ ;
-extern short MaxFD /* maximum number of FD's possible */ ;
+extern int MaxFD /* maximum number of FD's possible */ ;
-extern short nFDsInUse /* number of FD's actually in use */ ;
+extern int nFDsInUse /* number of FD's actually in use */ ;
extern fd_set ReadDescriptors /* bit map of FD's in use -- for select */ ;
extern fd_set WriteDescriptors /* bit map of write blocked FD's -- for select */;
extern fd_set BlockedReadDescriptors /* bit map of FD's blocked from reading */;
-extern short HighestFD /* highest FD in use -- for select */ ;
+extern int HighestFD /* highest FD in use -- for select */ ;
extern void InitializeFD(void);
extern void UsingFD(FD fd, void (*Handler)(int), void (*FlushHandler)(int),
diff --git a/scope.c b/scope.c
index f66def2..b8d9b57 100644
--- a/scope.c
+++ b/scope.c
@@ -93,12 +93,12 @@ char TerminateClose = 0;
int Interrupt = 0;
struct FDDescriptor *FDD = NULL;
-short MaxFD = 0;
-short nFDsInUse = 0;
+int MaxFD = 0;
+int nFDsInUse = 0;
fd_set ReadDescriptors;
fd_set WriteDescriptors;
fd_set BlockedReadDescriptors;
-short HighestFD;
+int HighestFD;
short debuglevel = 0;
short Verbose = 0;
--
1.7.3.2
More information about the xorg-devel
mailing list