The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > Developer > Omni Frameworks
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Strange line in NSBezierPath-OAExtensions.m Thread Tools Search this Thread Display Modes
I wonder if this is a bug:

NSBezierPath-OAExtensions.m:576 in -allIntersectionsWithPath:

intersections = realloc(intersections, sizeof(*intersections) * (listSize = intersectionCount));

Is the "=" intentional? I don't even understand what this method does and the only reason I'm looking at it is because LLVM/Clang complains so it's perhaps nothing...

Cheers,
Martin
 
I'm not familiar with that code, and I would agree that that causes one to do a bit of a double-take when looking at the code, but offhand it looks intentional. If you look around to see where listSize gets changed, it's in three places, and all three have the same pattern of assignment directly inline with calculation for memory allocation.
 
I probably wrote that. Yes, it's intentional; it's an idiom for keeping listSize in sync with the allocated size of the list. Old C coding habits die hard.

Interesting that clang complains about it. gcc has some heuristics for when to complain about legal-but-possibly-erroneous code like that; clang's heuristics are presumably different.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Round line ends not centered on end of line billbrietstout OmniGraffle General 3 2012-05-17 08:08 AM
Strange line problem SPA OmniGraffle General 1 2012-02-29 06:02 AM
strange ... mepossem OmniFocus 1 for Mac 1 2012-01-02 10:30 AM
Strange behavior of line and circle or bug ? jochen OmniGraffle General 2 2009-06-23 05:31 AM
strange slowliness sickbar OmniWeb Bug Reports 2 2006-11-15 12:55 PM


All times are GMT -8. The time now is 02:41 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.