[Insight-developers] Why is m_NumberOfThreads signed?

Johnson, Hans J hans-johnson at uiowa.edu
Mon May 16 11:54:10 EDT 2011


I also agree with David and Marius.

Hans
--
Hans J. Johnson, Ph.D.
hans-johnson at uiowa.edu<mailto:hans-johnson at uiowa.edu>
Assistant Professor of Psychiatry
University of Iowa Carver College of Medicine
W278 GH, 200 Hawkins Drive
Iowa City, Iowa 52242
Phone:  319-353-8587

From: <M.Staring at lumc.nl<mailto:M.Staring at lumc.nl>>
Date: Mon, 16 May 2011 14:38:11 +0000
To: Bill Lorensen <bill.lorensen at gmail.com<mailto:bill.lorensen at gmail.com>>, Bradley Lowekamp <blowekamp at mail.nih.gov<mailto:blowekamp at mail.nih.gov>>
Cc: ITK <insight-developers at itk.org<mailto:insight-developers at itk.org>>, Luis Ibanez <luis.ibanez at kitware.com<mailto:luis.ibanez at kitware.com>>
Subject: Re: [Insight-developers] Why is m_NumberOfThreads signed?

I agree with David.


-          There is already an impact on users when switching to ITK4. This is just a small addition.

-          Yes, when you are using int you get a warning, but it’s a good warning! It warns that you may use a negative number for something that is never negative.

For me ITK4 is the chance to do things the right way, also for these smaller nuisances. Otherwise we are stuck with it for the coming years.

Note that the recently refactored ImageToImageMetric does use unsigned int for the number of threads.

Cheers,

Marius



From: Bill Lorensen [mailto:bill.lorensen at gmail.com]
Sent: maandag 16 mei 2011 15:17
To: Bradley Lowekamp
Cc: David Doria; Insight Developers; Luis Ibanez; Staring, M. (LKEB)
Subject: Re: [Insight-developers] Why is m_NumberOfThreads signed?

I agree with Brad. Also, in customers' applications, they have been using int and they will have to change their code. Further it will be difficult to build an application against both ITK3 and ITK4 without #ifdef's. For example, Slicer4 currently builds against ITK3 and ITK4.

It seems the benefit ("it makes more sense") is small compared to the possible impact on our customers.

Bill
On Mon, May 16, 2011 at 9:04 AM, Bradley Lowekamp <blowekamp at mail.nih.gov<mailto:blowekamp at mail.nih.gov>> wrote:
But then all the people who just used int, would get a warning. I don't see an advantage.


On May 16, 2011, at 8:41 AM, David Doria wrote:


On Mon, May 16, 2011 at 8:38 AM, Bradley Lowekamp
<blowekamp at mail.nih.gov<mailto:blowekamp at mail.nih.gov>> wrote:

What is the motivation for changing this? Why is unsigned better the signed?

It came to my attention because I would do something like:

for(unsigned int i = 0; i < this->m_NumberOfThreads; ++i)

and get warnings about unsigned/signed comparisons.

Also, it just seems more "correct", as it doesn't make sense for the
number of threads to be negative.

David


========================================================

Bradley Lowekamp

Lockheed Martin Contractor for

Office of High Performance Computing and Communications

National Library of Medicine

blowekamp at mail.nih.gov<mailto:blowekamp at mail.nih.gov>



_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-developers

_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.html Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://www.itk.org/mailman/listinfo/insight-developers

________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110516/80c8a1f7/attachment-0001.htm>


More information about the Insight-developers mailing list