]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Fixed compile error on x86_64, see
authornamespace <namespace>
Mon, 11 Sep 2006 10:35:17 +0000 (10:35 +0000)
committernamespace <namespace>
Mon, 11 Sep 2006 10:35:17 +0000 (10:35 +0000)
http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=1105 for details.

git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@102 8a3a26a2-13c4-0310-b231-cf6edde360e5

CHANGES
libs/stream/textstream.h

diff --git a/CHANGES b/CHANGES
index da07893621c273e6ce2334157599fab904ff95c6..560d252dce6c2d6ab82987a3fbfe1a9952c46736 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,16 @@
 This is the changelog for developers, != changelog for the end user 
 that we distribute with the binaries. (see changelog)
 
 This is the changelog for developers, != changelog for the end user 
 that we distribute with the binaries. (see changelog)
 
+11/09/2006
+namespace
+- Fixed compile error on x86_64, see http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=1105
+  for details.
+
+09/09/2996
+namespace
+- Added strafing for the camerawindow while holding ctrl
+- Additional forward movement can be enabled by pressing shift during strafe
+
 22/08/2006
 SPoG
 - Added VFS support for locating the archive a file was loaded from.
 22/08/2006
 SPoG
 - Added VFS support for locating the archive a file was loaded from.
index 8e0c72c44ceff16a369ee28ae6028d86a39ec06e..fff8a457dd9e42361b373129701d656937f3ea8b 100644 (file)
@@ -46,6 +46,17 @@ namespace TextOutputDetail
     }
     return ptr;
   }
     }
     return ptr;
   }
+  
+  #if defined (_WIN64) || defined (__LP64__)
+  inline char* write_size_t_nonzero_decimal_backward(char* ptr, size_t decimal)
+  {
+    for (; decimal != 0; decimal /= 10)
+    {
+      *--ptr = char('0' + (size_t)(decimal % 10));
+    }
+    return ptr;
+  }
+  #endif
 
   inline char* write_signed_nonzero_decimal_backward(char* ptr, int decimal, bool show_positive)
   {
 
   inline char* write_signed_nonzero_decimal_backward(char* ptr, int decimal, bool show_positive)
   {
@@ -71,6 +82,18 @@ namespace TextOutputDetail
     }
     return ptr;
   }
     }
     return ptr;
   }
+  
+  #if defined (_WIN64) || defined (__LP64__)
+  inline char* write_size_t_nonzero_decimal_backward(char* ptr, size_t decimal, bool show_positive)
+  {
+    ptr = write_size_t_nonzero_decimal_backward(ptr, decimal);
+    if(show_positive)
+    {
+      *--ptr = '+';
+    }
+    return ptr;
+  }
+  #endif
 
   inline char* write_signed_decimal_backward(char* ptr, int decimal, bool show_positive)
   {
 
   inline char* write_signed_decimal_backward(char* ptr, int decimal, bool show_positive)
   {
@@ -97,6 +120,21 @@ namespace TextOutputDetail
     }
     return ptr;
   }
     }
     return ptr;
   }
+  
+  #if defined (_WIN64) || defined (__LP64__)
+  inline char* write_size_t_decimal_backward(char* ptr, size_t decimal, bool show_positive)
+  {
+    if(decimal == 0)
+    {
+      *--ptr = '0';
+    }
+    else
+    {
+      ptr = write_size_t_nonzero_decimal_backward(ptr, decimal, show_positive);
+    }
+    return ptr;
+  }
+  #endif
 }
 
 
 }
 
 
@@ -166,6 +204,27 @@ inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const
   return ostream;
 }
 
   return ostream;
 }
 
+#if defined (_WIN64) || defined (__LP64__)
+
+/// \brief Writes a size_t \p i to \p ostream in decimal form.
+template<typename TextOutputStreamType>
+inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const size_t i)
+{
+  // max is 18446744073709551615, buffer of 32 chars should always be enough
+  const std::size_t bufferSize = 32;
+#if 1
+  char buf[bufferSize];
+  char* begin = TextOutputDetail::write_size_t_decimal_backward(buf + bufferSize, i, false);
+  ostream.write(begin, (buf + bufferSize) - begin);
+#else
+  char buf[bufferSize];
+  ostream.write(buf, snprintf(buf, bufferSize, "%u", i));
+#endif
+  return ostream;
+}
+
+#endif
+
 /// \brief Writes a null-terminated \p string to \p ostream.
 template<typename TextOutputStreamType>
 inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const char* string)
 /// \brief Writes a null-terminated \p string to \p ostream.
 template<typename TextOutputStreamType>
 inline TextOutputStreamType& ostream_write(TextOutputStreamType& ostream, const char* string)