FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

something weird in mango

 
Post new topic   Reply to topic     Forum Index -> Mango
View previous topic :: View next topic  
Author Message
davidl



Joined: 17 Aug 2006
Posts: 27

PostPosted: Tue Jan 09, 2007 1:09 am    Post subject: something weird in mango Reply with quote

Index: icu/UConverter.d
===================================================================
--- icu/UConverter.d (revision 934)
+++ icu/UConverter.d (working copy)
@@ -447,8 +447,8 @@
void* dstLimit = dst + output.length;

ucnv_fromUnicode (handle, &dst, dstLimit, &src, srcLimit, null, flush, e);
- x.input = src - cast(wchar*) input;
- x.output = dst - cast(void*) output;
+ x.input = src - input.ptr;
+ x.output = dst - output.ptr;

if (e == e.BufferOverflow)
return true;
@@ -558,8 +558,8 @@
wchar* dstLimit = dst + output.length;

ucnv_toUnicode (handle, &dst, dstLimit, &src, srcLimit, null, flush, e);
- x.input = src - cast(void*) input;
- x.output = dst - cast(wchar*) output;
+ x.input = src - input.ptr;
+ x.output = dst - output.ptr;

if (e == e.BufferOverflow)
return true;
@@ -666,8 +666,8 @@
&src, srcLimit, null, null, null, null,
clear, flush, e);
clear = false;
- x.input = src - cast(void*) input;
- x.output = dst - cast(void*) output;
+ x.input = src - input.ptr;
+ x.output = dst - output.ptr;

if (e == e.BufferOverflow)
return true;
Index: io/Socket.d
===================================================================
--- io/Socket.d (revision 934)
+++ io/Socket.d (working copy)
@@ -1077,7 +1077,7 @@
protected bit isAlive()
{
int type, typesize = type.sizeof;
- return cast(bool) (getsockopt (sock, SOL_SOCKET, SO_TYPE, cast(char*) &type, &typesize) != SOCKET_ERROR);
+ return cast(bool) (getsockopt (sock, SOL_SOCKET, SO_TYPE, cast(char*)&type, &typesize) != SOCKET_ERROR);
}


@@ -2198,7 +2198,7 @@

uint* first()
{
- return cast(uint*)buf;
+ return buf.ptr;
}
}

i don't know if they are intended.
no returns
and inout param never get changed
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Tue Jan 09, 2007 7:13 pm    Post subject: Reply with quote

thanks much;

- you mentioned no returns -- where are those?
- sometimes inout is used to pass structs around as pointers rather than as values. Is that the case where you noticed them?

- Kris
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Mango All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group