dotgnu-pnet-commits
[Top][All Lists]
Advanced

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

[dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and to


From: Klaus Treichel
Subject: [dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and tools (pnet) branch, master, updated. 0bcd8b91a1463f78b5c7fd228bbf21dda9c29201
Date: Sun, 15 Nov 2009 17:14:29 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "DotGNU Portable.NET engine, compilers and tools (pnet)".

The branch, master has been updated
       via  0bcd8b91a1463f78b5c7fd228bbf21dda9c29201 (commit)
      from  19fbd51c2c856085a35d59e66f343d34e96483b5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/pnet.git/commit/?id=0bcd8b91a1463f78b5c7fd228bbf21dda9c29201

commit 0bcd8b91a1463f78b5c7fd228bbf21dda9c29201
Author: Klaus Treichel <address@hidden>
Date:   Sun Nov 15 18:14:11 2009 +0100

    Fix some compiler warnings.

diff --git a/ChangeLog b/ChangeLog
index 6e1fcb0..c33194f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,19 @@
        -fno-inline-small-functions and -fno-inline-functions-called-once and
        add them to NO_INLINE_FUNCTIONS.
 
+       * engine/lib_socket.c (_IL_IPAddress_HostToNetworkOrder_l): Use a
+       conversion helper union to fix a type pruned pointer warning.
+       (_IL_IPAddress_HostToNetworkOrder_i): likewise
+       (_IL_IPAddress_HostToNetworkOrder_s): likewise
+
+       * engine/lib_stringbuilder.c (Append): Change type of value argument 
from
+       ILInt16 * to ILUInt16 *.
+       (_IL_StringBuilder_Append_ac): Cast value argument in call to Append 
from
+       ILInt16 * to ILUInt16 *.
+       (_IL_StringBuilder_Appendacii): likewise
+       (_IL_StringBuilder_Insert_iStringi): Change type of buf from ILInt16 * 
to
+       ILUInt16 *.
+
        * support/socket.c (ILSysIOSockesAccept): Change sa_len to socklen_t on
        non windows systems.
        (ILSysIOSocketRecvFrom): likewise
diff --git a/engine/lib_socket.c b/engine/lib_socket.c
index 1adaa82..61288b7 100644
--- a/engine/lib_socket.c
+++ b/engine/lib_socket.c
@@ -41,6 +41,15 @@
 
 #ifdef IL_CONFIG_NETWORKING
 
+typedef union
+{
+       ILUInt8         uint8Values[8];
+       ILInt16         int16Value;
+       ILInt32         int32Value;
+       ILInt64         int64Value;
+       
+} _ILSocketConversionHelper;
+
 /*
  * public static IntPtr GetInvalidHandle();
  */
@@ -431,16 +440,17 @@ void _IL_SocketMethods_WaitHandleSet(ILExecThread 
*_thread,
  */
 ILInt64 _IL_IPAddress_HostToNetworkOrder_l(ILExecThread *thread, ILInt64 host)
 {
-       unsigned char volatile value[8];
-       value[0] = (unsigned char)(host >> 56);
-       value[1] = (unsigned char)(host >> 48);
-       value[2] = (unsigned char)(host >> 40);
-       value[3] = (unsigned char)(host >> 32);
-       value[4] = (unsigned char)(host >> 24);
-       value[5] = (unsigned char)(host >> 16);
-       value[6] = (unsigned char)(host >> 8);
-       value[7] = (unsigned char)host;
-       return *((ILInt64 *)value);
+       _ILSocketConversionHelper conv;
+
+       conv.uint8Values[0] = (unsigned char)(host >> 56);
+       conv.uint8Values[1] = (unsigned char)(host >> 48);
+       conv.uint8Values[2] = (unsigned char)(host >> 40);
+       conv.uint8Values[3] = (unsigned char)(host >> 32);
+       conv.uint8Values[4] = (unsigned char)(host >> 24);
+       conv.uint8Values[5] = (unsigned char)(host >> 16);
+       conv.uint8Values[6] = (unsigned char)(host >> 8);
+       conv.uint8Values[7] = (unsigned char)host;
+       return conv.int64Value;
 }
 
 /*
@@ -448,12 +458,13 @@ ILInt64 _IL_IPAddress_HostToNetworkOrder_l(ILExecThread 
*thread, ILInt64 host)
  */
 ILInt32 _IL_IPAddress_HostToNetworkOrder_i(ILExecThread *thread, ILInt32 host)
 {
-       unsigned char volatile value[4];
-       value[0] = (unsigned char)(host >> 24);
-       value[1] = (unsigned char)(host >> 16);
-       value[2] = (unsigned char)(host >> 8);
-       value[3] = (unsigned char)host;
-       return *((ILInt32 *)value);
+       _ILSocketConversionHelper conv;
+       
+       conv.uint8Values[0] = (ILUInt8)(host >> 24);
+       conv.uint8Values[1] = (ILUInt8)(host >> 16);
+       conv.uint8Values[2] = (ILUInt8)(host >> 8);
+       conv.uint8Values[3] = (ILUInt8)host;
+       return conv.int32Value;
 }
 
 /*
@@ -461,10 +472,11 @@ ILInt32 _IL_IPAddress_HostToNetworkOrder_i(ILExecThread 
*thread, ILInt32 host)
  */
 ILInt16 _IL_IPAddress_HostToNetworkOrder_s(ILExecThread *thread, ILInt16 host)
 {
-       unsigned char volatile value[2];
-       value[0] = (unsigned char)(host >> 8);
-       value[1] = (unsigned char)host;
-       return *((ILInt16 *)value);
+       _ILSocketConversionHelper conv;
+       
+       conv.uint8Values[0] = (unsigned char)(host >> 8);
+       conv.uint8Values[1] = (unsigned char)host;
+       return conv.int16Value;
 }
 
 #define        GETBYTE(type,value,offset,shift)        \
diff --git a/engine/lib_stringbuilder.c b/engine/lib_stringbuilder.c
index fbd657c..35272e3 100755
--- a/engine/lib_stringbuilder.c
+++ b/engine/lib_stringbuilder.c
@@ -62,7 +62,7 @@ static IL_INLINE ILInt32 NewCapacity(ILInt32 length, ILInt32 
oldCapacity)
  */
 static ILObject * Append(ILExecThread * _thread,
                                                        
System_Text_StringBuilder * _this,
-                                                       ILInt16 * value,
+                                                       ILUInt16 * value,
                                                        ILInt32 length)
 {
        ILInt32 newLength = _this->buildString->length + length;
@@ -316,7 +316,7 @@ ILObject * _IL_StringBuilder_Append_ac(ILExecThread * 
_thread,
                if(ArrayLength(value) > 0)
                {
                        return Append(_thread, (System_Text_StringBuilder 
*)_this,
-                                                       (ILInt16 
*)ArrayToBuffer(value),
+                                                       (ILUInt16 
*)ArrayToBuffer(value),
                                                        ArrayLength(value));
                }
        }
@@ -353,7 +353,7 @@ ILObject * _IL_StringBuilder_Append_acii(ILExecThread * 
_thread,
                if(length > 0)
                {
                        return Append(_thread, (System_Text_StringBuilder 
*)_this,
-                                                       ((ILInt16 
*)ArrayToBuffer(value)) + startIndex,
+                                                       ((ILUInt16 
*)ArrayToBuffer(value)) + startIndex,
                                                        length);
                }
        }
@@ -655,7 +655,7 @@ ILObject * _IL_StringBuilder_Insert_iStringi(ILExecThread * 
_thread,
                                                        index,
                                                        ((System_String 
*)value)->length * count))
                        {
-                               ILInt16 * buf = 
StringToBuffer(BuildString(_this)) + index;
+                               ILUInt16 *buf = 
StringToBuffer(BuildString(_this)) + index;
                                while(count > 0)
                                {
                                        ILMemCpy(buf,

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                  |   13 +++++++++++
 engine/lib_socket.c        |   52 +++++++++++++++++++++++++++-----------------
 engine/lib_stringbuilder.c |    8 +++---
 3 files changed, 49 insertions(+), 24 deletions(-)


hooks/post-receive
-- 
DotGNU Portable.NET engine, compilers and tools (pnet)




reply via email to

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