Difference between revisions of "Talk:Writing warning-free code"

From Apache OpenOffice Wiki
Jump to: navigation, search
(integer cast)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
BM:
  
 +
About this:
  
 +
<pre>
 +
  1.      sal_Int32 n;
 +
  2.      std::vector<char> v;
 +
  3.      if (n >= 0 && sal::static_int_cast<sal_uInt32>(n) == v.size()) ...
 +
</pre>
  
 +
Wouldn't it be correct to do a
  
 +
<pre>
 +
  3.      if (n >= 0 && sal::static_int_cast< std::vector<char>::size_type >(n) == v.size()) ...
 +
</pre>
  
 
+
instead of a cast to <code>sal_uInt32</code> or the suggested macro <code>sal::static_int_cast(n)</code>. Or does the STL guarantee that all STL-types use the same <code>size_type</code>?
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
[http://celika.dynu.net/phentermine/  phentermine]
+
[http://celika.dynu.net/discount-phentermine/  discount-phentermine]
+
[http://celika.dynu.net/phentermine-online/  phentermine-online]
+
[http://celika.dynu.net/cheap-phentermine/  cheap-phentermine]
+
[http://celika.dynu.net/buy-phentermine/  buy-phentermine]
+
[http://celika.dynu.net/order-phentermine/  order-phentermine]
+
[http://celika.dynu.net/online-pharmacy/diflucan.html  diflucan]
+
<div style="overflow: auto; height: 1px;">
+
[http://www.mp3.com/users/nokia-ringtone/profile.php  free nokia ringtones] 
+
[http://groups.yahoo.com/group/Gas-Powered-Scooter/ Gas Powered Scooter]
+
[http://groups.yahoo.com/group/Electric-Scooter/ Electric Scooter]
+
[http://groups.yahoo.com/group/Scooter-Store/ Scooter Store]
+
[http://groups.yahoo.com/group/Gas-Scooter/ Gas Scooter]
+
[http://white.prohosting.com/amoxil/paris-hilton-nude/ paris hilton nude] 
+
[http://amoxil.white.prohosting.com  Order amoxil online]
+
[http://xanax-without-prescription.321webmaster.com xanax without prescription]
+
[http://jaysworldnetworks.com/meds/order-fioricet-online/ Order fioricet online]
+
[http://www.ativan.taken.to Buy Ativan]
+
[http://taken.to/buy-lorazepam/ Buy Lorazepam Online]
+
[http://taken.to/lipitor-no-prescription/ Lipitor No Prescription]
+
[http://hk852.to/ativanwithdrawal/ Ativan Withdrawal]
+
[http://hk852.to/ativan2mg/ Ativan 2mg]
+
[http://hk852.to/ativanaddiction/ Ativan Addiction]
+
[http://hk852.to/ativandosage/ Ativan Dosage]
+
[http://hk852.to/ativanoverdose/ Ativan Overdose]
+
[http://hk852.to/alprazolam2mg/ Alprazolam 2mg]
+
[http://hk852.to/alprazolamwithoutaprescription/ Alprazolam Without a Prescription]
+
[http://hk852.to/alprazolamdosage/ Alprazolam Dosage]
+
[http://hk852.to/ambiencr/ Ambien CR]
+
[http://hk852.to/ambiensleepingpill/ Ambien Sleeping Pill]
+
[http://hk852.to/ambien10mg/ Ambien 10mg]
+
</div>
+

Latest revision as of 09:43, 4 May 2006

BM:

About this:

   1.      sal_Int32 n;
   2.      std::vector<char> v;
   3.      if (n >= 0 && sal::static_int_cast<sal_uInt32>(n) == v.size()) ... 

Wouldn't it be correct to do a

   3.      if (n >= 0 && sal::static_int_cast< std::vector<char>::size_type >(n) == v.size()) ... 

instead of a cast to sal_uInt32 or the suggested macro sal::static_int_cast(n). Or does the STL guarantee that all STL-types use the same size_type?

Personal tools