help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] [PATCH] rename FileDescriptor's file instance variable


From: Paolo Bonzini
Subject: [Help-smalltalk] [PATCH] rename FileDescriptor's file instance variable to fd
Date: Sat, 05 Apr 2008 14:53:50 -0000

This is the first of 10 patches that will include a complete rewrite
of the VFS filesystem.  This has quite a few ramifications.  For now,
this patch renames a badly named variable in FileDescriptor.

I'm not posting ChangeLogs, but the committed patch will have one.

---
 kernel/FileDescr.st |   13 ++++++-------
 libgst/dict.c       |    2 +-
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/kernel/FileDescr.st b/kernel/FileDescr.st
index 83a6044..c2f7ff0 100644
--- a/kernel/FileDescr.st
+++ b/kernel/FileDescr.st
@@ -33,7 +33,7 @@
 
 
 ByteStream subclass: FileDescriptor [
-    | file name isPipe atEnd peek |
+    | fd name isPipe atEnd peek |
     
     <category: 'Streams-Files'>
     <comment: 'My instances are what conventional programmers think of as 
files.
@@ -291,7 +291,7 @@ do arbitrary processing on the files.'>
        "Invalidate a file descriptor"
 
        <category: 'basic'>
-       file := nil
+       fd := nil
     ]
 
     shutdown [
@@ -593,7 +593,7 @@ do arbitrary processing on the files.'>
        "Answer whether the file is still open"
 
        <category: 'accessing'>
-       ^file isInteger and: [file positive]
+       ^fd isInteger and: [fd positive]
     ]
 
     isPipe [
@@ -608,7 +608,7 @@ do arbitrary processing on the files.'>
        "Return the OS file descriptor of the file"
 
        <category: 'accessing'>
-       ^file
+       ^fd
     ]
 
     name [
@@ -716,11 +716,10 @@ do arbitrary processing on the files.'>
        name := aString
     ]
 
-    setFD: fd [
+    setFD: anInteger [
        <category: 'private'>
        access := 3.
-       file := fd.
-       name := 'descriptor #' , fd printString.
+       fd := anInteger.
        isPipe := nil
     ]
 
diff --git a/libgst/dict.c b/libgst/dict.c
index 6600b1b..9b7df2a 100644
--- a/libgst/dict.c
+++ b/libgst/dict.c
@@ -617,7 +617,7 @@ static const class_definition class_info[] = {
 
   {&_gst_file_descriptor_class, &_gst_byte_stream_class,
    ISP_FIXED, true, 5,
-   "FileDescriptor", "file name isPipe atEnd peek", "AllOpenFiles", NULL },
+   "FileDescriptor", "fd name isPipe atEnd peek", "AllOpenFiles", NULL },
 
   {&_gst_file_stream_class, &_gst_file_descriptor_class,
    ISP_FIXED, true, 2,
-- 
1.5.3.4.910.gc5122-dirty





reply via email to

[Prev in Thread] Current Thread [Next in Thread]