<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Signed / unsigned comparision in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605129#M16753</link>
    <description>{quote}&lt;BR /&gt;
&lt;BR /&gt;
Actually, the platform and processor architecture determines&lt;BR /&gt;
the size of almost every integral type&lt;BR /&gt;
&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
Actually, you're confusing the language specification with the&lt;BR /&gt;
Microsoft Visual C++ implementation of it, where 'platform-&lt;BR /&gt;
dependent' mainly pertains to the differences that exist between&lt;BR /&gt;
the 32 bit x86 achitecture, and its 64 bit extensions (AMD64 and&lt;BR /&gt;
IA64), and have little relevance to other architectures, like older&lt;BR /&gt;
16 bit architectures, or those used in embedded systems.&lt;BR /&gt;
&lt;BR /&gt;
On 64 bit Windows, Visual C++ uses the LLP64 data model&lt;BR /&gt;
(most UNIX/LINUX C++ compilers use LP64). In LLP64, all&lt;BR /&gt;
native integral types are not platform-dependent, and have the&lt;BR /&gt;
same size on 32 and 64 bit platforms.&lt;BR /&gt;
&lt;BR /&gt;
In LP64, the only native integral type whose size is platform-&lt;BR /&gt;
dependent is a long.&lt;BR /&gt;
&lt;BR /&gt;
The data model used by the compiler determines the size of&lt;BR /&gt;
native types and whether they are platform-dependent, or not.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2010&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");</description>
    <pubDate>Sun, 03 Jan 2010 07:08:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-01-03T07:08:17Z</dc:date>
    <item>
      <title>Signed / unsigned comparision</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605122#M16746</link>
      <description>&lt;P&gt;&lt;BR /&gt;
Im in the process of converting my app to 64bit, and was wondering what is the best practise way of doing the following;&lt;BR /&gt;
&lt;/P&gt;&lt;BR /&gt;
&lt;ADDRESS&gt;&lt;BR /&gt;
{color:#3366ff}someMethod(int index){color}&lt;/ADDRESS&gt;&lt;BR /&gt;
&lt;BR /&gt;
{color:#3366ff} if (index &amp;lt; acdbPolyLine.numVerts()){color}&lt;BR /&gt;
&lt;ADDRESS&gt;&lt;BR /&gt;
{color:#3366ff}       //do something&lt;BR /&gt;&lt;BR /&gt;
}{color}&lt;/ADDRESS&gt;&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
where 'index' is a signed integer  and NumVerts() returns an unsigned integer.&lt;BR /&gt;&lt;BR /&gt;
a similar situation being&lt;BR /&gt;
&lt;/P&gt;&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;
{color:#3366ff}for (int index = 0; index &amp;lt; numVerts(); index++){color}&lt;BR /&gt;
&lt;/P&gt;&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
is an (int) cast on numVerts() sufficient?&lt;BR /&gt;&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;/P&gt;

Edited by: petepete on Dec 17, 2009 11:46 AM</description>
      <pubDate>Thu, 17 Dec 2009 11:44:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605122#M16746</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-17T11:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Signed / unsigned comparision</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605123#M16747</link>
      <description>I've been using size_t</description>
      <pubDate>Thu, 17 Dec 2009 11:55:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605123#M16747</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-17T11:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Signed / unsigned comparision</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605124#M16748</link>
      <description>Why not just make index an unsigned int?</description>
      <pubDate>Mon, 28 Dec 2009 21:08:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605124#M16748</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-28T21:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Signed / unsigned comparision</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605125#M16749</link>
      <description>I guess because on a 64 bit machine, an array can grow larger (in therory) than  an unsigned int. &lt;BR /&gt;
&lt;BR /&gt;
from the ARX docs&lt;BR /&gt;
"The C++ size_t type is defined as the result of the sizeof operator and can contain the size of any object. STL and MFC containers typically return their size as a size_t value. In the IA-32 programming model, size_t is 32 bits wide. In X64, it is 64 bits wide."</description>
      <pubDate>Mon, 28 Dec 2009 22:41:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605125#M16749</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-28T22:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Signed / unsigned comparision</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605126#M16750</link>
      <description>Because an unsigned int is not a platform-dependent type.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2010&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;THATCADGUY&gt; wrote in message news:6309789@discussion.autodesk.com...&lt;BR /&gt;
Why not just make index an unsigned int?&lt;/THATCADGUY&gt;</description>
      <pubDate>Tue, 29 Dec 2009 08:08:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605126#M16750</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-29T08:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Signed / unsigned comparision</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605127#M16751</link>
      <description>Ah.  Yeah, I kind of disregarded the name of the variable.  Assuming index is an array index, then index should be a size_t type and an implicit (size_t) cast should be used on the return value from NumVerts().  I was thinking more along the lines of performance, where it'd make sense to just have index be an unsigned int (assuming it doesn't ever have to be negative), which would save a cast.</description>
      <pubDate>Tue, 29 Dec 2009 14:14:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605127#M16751</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-29T14:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Signed / unsigned comparision</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605128#M16752</link>
      <description>Actually, the platform and processor architecture determines the size of almost every integral type.  The integral types defined in stdint.h are the only truly non-platform-dependent types that I know of.</description>
      <pubDate>Tue, 29 Dec 2009 14:18:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605128#M16752</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-29T14:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Signed / unsigned comparision</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605129#M16753</link>
      <description>{quote}&lt;BR /&gt;
&lt;BR /&gt;
Actually, the platform and processor architecture determines&lt;BR /&gt;
the size of almost every integral type&lt;BR /&gt;
&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
Actually, you're confusing the language specification with the&lt;BR /&gt;
Microsoft Visual C++ implementation of it, where 'platform-&lt;BR /&gt;
dependent' mainly pertains to the differences that exist between&lt;BR /&gt;
the 32 bit x86 achitecture, and its 64 bit extensions (AMD64 and&lt;BR /&gt;
IA64), and have little relevance to other architectures, like older&lt;BR /&gt;
16 bit architectures, or those used in embedded systems.&lt;BR /&gt;
&lt;BR /&gt;
On 64 bit Windows, Visual C++ uses the LLP64 data model&lt;BR /&gt;
(most UNIX/LINUX C++ compilers use LP64). In LLP64, all&lt;BR /&gt;
native integral types are not platform-dependent, and have the&lt;BR /&gt;
same size on 32 and 64 bit platforms.&lt;BR /&gt;
&lt;BR /&gt;
In LP64, the only native integral type whose size is platform-&lt;BR /&gt;
dependent is a long.&lt;BR /&gt;
&lt;BR /&gt;
The data model used by the compiler determines the size of&lt;BR /&gt;
native types and whether they are platform-dependent, or not.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2010&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");</description>
      <pubDate>Sun, 03 Jan 2010 07:08:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/signed-unsigned-comparision/m-p/2605129#M16753</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-03T07:08:17Z</dc:date>
    </item>
  </channel>
</rss>

