Author: prom
Date: Fri Nov 26 04:07:47 2004
New Revision: 9616
Modified:
trunk/src/common/file-system/directories.dylan
trunk/src/common/network/unix-network-library.dylan
trunk/src/common/system/file-system/unix-file-system.dylan
trunk/src/common/system/unix-operating-system.dylan
trunk/src/d2c/runtime/melange/exports.dylan
trunk/src/d2c/runtime/melange/melange.dylan
trunk/src/platform/gtk+/gtk2/gtk-internal-support.dylan
Log:
Bug: 7205
Removed null-pointer from melange-support in favor of $null-pointer
so melange-support doesnt clash with c-ffi.
Modified: trunk/src/common/file-system/directories.dylan
==============================================================================
--- trunk/src/common/file-system/directories.dylan (original)
+++ trunk/src/common/file-system/directories.dylan Fri Nov 26 04:07:47 2004
@@ -40,7 +40,7 @@
#else
// ooOOoOOoh! This gets weird quickly! -- melange to the rescue!
let dir* = open-dir(dir-name);
- if(dir* = null-pointer) file-signal("opendir", dir-name); end if;
+ if(dir* = $null-pointer) file-signal("opendir", dir-name); end if;
block()
while(#t)
let (name, type) = dir-element(dir*, dir-name);
@@ -76,9 +76,9 @@
define function dir-element(dir :: <machine-pointer>, path :: <pathname>)
=> (name :: <string>, type :: <file-type>)
- if(dir = null-pointer) end-of-directory(); end if;
+ if(dir = $null-pointer) end-of-directory(); end if;
let file = gd-readdir(dir);
- if(file = null-pointer) end-of-directory(); end if;
+ if(file = $null-pointer) end-of-directory(); end if;
let name = convert-to-string(gd-dirent-name(file));
let stat = with-pointer(path = concatenate(as-dir(path), name))
Modified: trunk/src/common/network/unix-network-library.dylan
==============================================================================
--- trunk/src/common/network/unix-network-library.dylan (original)
+++ trunk/src/common/network/unix-network-library.dylan Fri Nov 26 04:07:47 2004
@@ -18,7 +18,7 @@
define module C-FFI
use common-dylan;
use machine-words;
- use melange-support, exclude: { null-pointer };
+ use melange-support;
export
<C-char*>,
@@ -41,7 +41,7 @@
exclude: { close };
use C-FFI;
use machine-words;
- use melange-support, exclude: { null-pointer };
+ use melange-support;
// Misc
export
@@ -200,7 +200,7 @@
define module sockets-internals
use common-dylan, exclude: { format-to-string };
- use melange-support, exclude: { null-pointer };
+ use melange-support;
use system, import: { vector-elements-address };
use machine-words;
use C-FFI;
Modified: trunk/src/common/system/file-system/unix-file-system.dylan
==============================================================================
--- trunk/src/common/system/file-system/unix-file-system.dylan (original)
+++ trunk/src/common/system/file-system/unix-file-system.dylan Fri Nov 26
04:07:47 2004
@@ -24,7 +24,7 @@
copy-sequence(first, start: 1)
end;
let passwd = %getpwnam(name);
- if (passwd ~= null-pointer)
+ if (passwd ~= $null-pointer)
let homedir = as(<native-directory-locator>, pw-dir(passwd));
merge-locators(make(<native-directory-locator>,
path: copy-sequence(elements, start: 1),
@@ -230,7 +230,7 @@
unix-file-error("get the author of", "%s", file)
end;
let passwd = %getpwuid(st-uid(st));
- if (passwd ~= null-pointer)
+ if (passwd ~= $null-pointer)
as(<byte-string>, pw-name(passwd))
else
unix-file-error("get the author of", "%s", file)
@@ -373,15 +373,15 @@
define function %do-directory
(f :: <function>, directory :: <posix-directory-locator>) => ()
let directory = %expand-pathname(directory);
- let directory-fd :: <DIR*> = as(<DIR*>, null-pointer);
+ let directory-fd :: <DIR*> = as(<DIR*>, $null-pointer);
block ()
directory-fd := %opendir(as(<byte-string>, directory));
- if (directory-fd = null-pointer)
+ if (directory-fd = $null-pointer)
unix-file-error("start listing of", "%s", directory)
end;
unix-last-error() := 0;
let dirent = %readdir(directory-fd);
- while (dirent ~= null-pointer)
+ while (dirent ~= $null-pointer)
let filename :: <byte-string> = dirent-name(dirent);
let type :: <file-type>
= %file-type(make(<posix-file-locator>,
@@ -399,7 +399,7 @@
unix-file-error("continue listing of", "%s", directory)
end;
cleanup
- if (directory-fd ~= null-pointer)
+ if (directory-fd ~= $null-pointer)
%closedir(directory-fd);
end
end
@@ -463,7 +463,7 @@
let buffer :: <c-string> = make(<c-string>, size: bufsiz, fill: '\0');
let result :: <c-string> = %getcwd(buffer, bufsiz);
- if (result ~= null-pointer)
+ if (result ~= $null-pointer)
as(<directory-locator>, buffer);
elseif (unix-last-error() = $ERANGE)
getcwd-with-size(bufsiz * 2);
Modified: trunk/src/common/system/unix-operating-system.dylan
==============================================================================
--- trunk/src/common/system/unix-operating-system.dylan (original)
+++ trunk/src/common/system/unix-operating-system.dylan Fri Nov 26 04:07:47 2004
@@ -31,7 +31,7 @@
define function login-group () => (group :: false-or(<string>))
let gid = %getgid();
let gr-ent = %getgrgid(gid);
- if (gr-ent = null-pointer)
+ if (gr-ent = $null-pointer)
#f
else
gr-ent.gr-name
@@ -53,7 +53,7 @@
define function environment-variable
(name :: <byte-string>) => (value :: false-or(<byte-string>))
let v = %getenv(name);
- if (v = null-pointer)
+ if (v = $null-pointer)
#f
else
as(<byte-string>, v)
Modified: trunk/src/d2c/runtime/melange/exports.dylan
==============================================================================
--- trunk/src/d2c/runtime/melange/exports.dylan (original)
+++ trunk/src/d2c/runtime/melange/exports.dylan Fri Nov 26 04:07:47 2004
@@ -45,7 +45,7 @@
export
//c-variable-ref, c-variable-ref-setter, // deprecated for new work, will
be removed soon
c-variable, c-variable-setter, // use these for development
- <statically-typed-pointer>, raw-value, null-pointer,
+ <statically-typed-pointer>, raw-value, $null-pointer,
signed-byte-at, signed-byte-at-setter,
unsigned-byte-at, unsigned-byte-at-setter, signed-short-at,
signed-short-at-setter, unsigned-short-at, unsigned-short-at-setter,
@@ -59,7 +59,7 @@
structure-size, export-value, import-value, <machine-pointer>,
<c-string>, <c-vector>, <function-pointer>,
- $null-pointer, <void>,
+ <void>,
c-struct-members;
end module melange-support;
Modified: trunk/src/d2c/runtime/melange/melange.dylan
==============================================================================
--- trunk/src/d2c/runtime/melange/melange.dylan (original)
+++ trunk/src/d2c/runtime/melange/melange.dylan Fri Nov 26 04:07:47 2004
@@ -118,7 +118,7 @@
unsigned-int:
(content-size(cls) + extra-bytes) * element-count);
let ptr = next(cls, pointer: rawptr);
- if (ptr = null-pointer) error("Make failed to allocate memory.") end if;
+ if (ptr = $null-pointer) error("Make failed to allocate memory.") end if;
apply(initialize, ptr, rest);
@@ -169,11 +169,9 @@
obj.raw-value;
end method as;
-define constant null-pointer :: <statically-typed-pointer>
+define constant $null-pointer :: <statically-typed-pointer>
= as(<statically-typed-pointer>, 0);
-define constant $null-pointer :: <statically-typed-pointer> = null-pointer;
-
define sealed inline method signed-byte-at
(ptr :: <statically-typed-pointer>, #key offset :: <integer> = 0)
=> (result :: <integer>);
@@ -483,7 +481,7 @@
values(0, #f,
method (str, state) state + 1 end method,
method (str, state, limit)
- str = null-pointer | unsigned-byte-at(str, offset: state) == 0;
+ str = $null-pointer | unsigned-byte-at(str, offset: state) == 0;
end method,
method (str, state) state end method,
method (str, state)
@@ -513,13 +511,13 @@
define sealed method size (string :: <c-string>)
=> result :: <integer>;
case
- (string = null-pointer) => 0;
+ (string = $null-pointer) => 0;
otherwise => call-out("strlen", int:, ptr: string.raw-value);
end case;
end method size;
define sealed method empty? (string :: <c-string>) => (result :: <boolean>);
- string = null-pointer | unsigned-byte-at(string) = 0;
+ string = $null-pointer | unsigned-byte-at(string) = 0;
end method empty?;
define constant space-byte = as(<integer>, ' ');
@@ -527,7 +525,7 @@
=> value :: <integer>;
let sz = string.size;
case
- value = null-pointer =>
+ value = $null-pointer =>
error("Cannot set size of null <c-string>s");
value == sz =>
#f;
Modified: trunk/src/platform/gtk+/gtk2/gtk-internal-support.dylan
==============================================================================
--- trunk/src/platform/gtk+/gtk2/gtk-internal-support.dylan (original)
+++ trunk/src/platform/gtk+/gtk2/gtk-internal-support.dylan Fri Nov 26
04:07:47 2004
@@ -103,7 +103,7 @@
arg in arguments)
argv[i] := arg;
end for;
- as(<c-pointer-vector>, argv)[argc] := null-pointer;
+ as(<c-pointer-vector>, argv)[argc] := $null-pointer;
let pargc = make(<int*>);
pointer-value(pargc) := argc;
let pargv = make(<char***>);
_______________________________________________
Gd-chatter mailing list
Gd-chatter@xxxxxxxxxxxxxxxx
https://gauss.gwydiondylan.org/mailman/listinfo/gd-chatter
|