Re: Technical review requested



Thank you for doing this, I learned a few things.

--Ray Strode

Small patch:

--- portable-programming.xml.orig       2002-09-04 18:00:26.000000000 -1000
+++ portable-programming.xml    2002-09-04 18:01:55.000000000 -1000
@@ -672,7 +672,7 @@
<para>In this section, I will mention a few of the small coding errors that seem to appear over and over again. Naturally, this list is not exhaustive and if your favourite coding error is not in the list, by
-         all means send it me for inclusion in a future version of this
+         all means send it to me for inclusion in a future version of this
         document. </para>

         <itemizedlist>
@@ -743,6 +743,20 @@
               between disparate types. </para>
            </listitem>
            <listitem>
+ <para>Sometimes it is useful to store an integer in a pointer
+                variable. If you do this, make sure you use the
+                GINT_TO_POINTER() and GPOINTER_TO_INT() macros.  Different
+                platforms require different typecasts.
+                </para>
+            </listitem>
+            <listitem>
+ <para>There are times when it may be tempting to store a memory
+                address inside an integer variable.  Don't do it.  On some
+ platforms the size of integer types are less than the size of
+                pointer types.
+                </para>
+            </listitem>
+            <listitem>
               <para>As mentioned earlier, use the
               <literal>G_INT64_FORMAT</literal> and similar macros, rather
than hard coding the print format string in your code. The format





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