Commit Graph

51100 Commits

Author SHA1 Message Date
Adrien Destugues
6a545a8eb1 libvterm: C89 backport.
* As a separate commit so next time the update will be easier...
2014-08-11 23:14:44 +02:00
Adrien Destugues
1ec255178a Import libvterm r617. 2014-08-11 23:14:42 +02:00
Adrien Destugues
b54c6f2e65 SerialConnect: fix font metrics for good.
* Set the background color in AttachedToWindow to avoid white lines in
initial drawing,
* Fix computation of font size again so lines don't overlap.

Note: lines are apparently spaced 1px less than in Terminal. But they
don't seem to touch or overlap each other in SerialConnect.
2014-08-11 23:14:41 +02:00
Jérôme Duval
c9a4d52483 acpi_button: fix build with gcc 4.9 2014-08-11 22:11:10 +02:00
Adrien Destugues
ab4411e89a Tracker new templates: update copyright year. 2014-08-11 21:03:02 +02:00
François Revol
e6c495bc73 Add a croissant icon
Just because I'm hungry, inspired by a drawing from
Bruny Bellamy:
http://brunobellamy.tumblr.com/post/94366925615
2014-08-11 16:15:41 +02:00
François Revol
a898bb9032 gopher: Resolve TODO 2014-08-11 15:26:43 +02:00
Michael Lotz
88b722965a exfat: Add missing locking around SplayTree lookup/insertion.
A lookup in a splay tree does move the looked up entry to the root of
the tree. This means the tree structure is modified on lookup alone.
Obviously the tree structure is also modified when inserting new nodes.

For both of these reasons access to the f{Node|Ino}Tree needs to be
locked on lookup and insert.

Fixes crashes when the tree is concurrently modified by multiple threads
accessing the same exfat volume.

In addition this protects the fNextId field that hands out new inode
ids.
2014-08-10 22:18:53 +02:00
John Scipione
3e2653e609 Tracker: re-add includes that were lost during merge 2014-08-10 16:16:54 -04:00
John Scipione
2f60dea53a Tracker: Throw exception on assert failure
... in situations where a NULL pointer dereference was vital to the
functioning of the method we use a stronger assert that throws an
exception on failure. This is accomplished by a new method in
Utilities.cpp, ThrowOnAssert().

None of these conditions should ever be true, if they are it means that
the code is written improperly and would have resulted in a NULL
dereference and undefined behavior (most likely a crash) before.

Most instances of ThrowOnAssert() either replace an ASSERT followed
by a dereference or an early return that covered the error.

Also remove _ThrowOnErrorWithMessage() which wasn't being used.
2014-08-10 15:07:38 -04:00
John Scipione
9cc03189fa Tracker: Add NULL checks and ASSERTs
To prevent recoverable NULL pointer dereferences. Dereferencing a
NULL pointer is undefined behavior and should be avoided.

Unrecoverable NULL checks will be dealt with in the next commit.
2014-08-10 15:07:37 -04:00
John Scipione
e47063d2de Tracker: Don't need to cast to BWindow here 2014-08-10 15:07:35 -04:00
John Scipione
d48f1c2e3c Tracker: code simplication, don't check if NULL
just pass in NULL, that's what is happening anyway.
2014-08-10 15:07:33 -04:00
John Scipione
82d9f9d119 Tracker: Use main screen if window is NULL
Here we try to determine the screen frame of screen that the window is on,
use the main screen when window is NULL.
2014-08-10 15:07:31 -04:00
John Scipione
3c4e26995c Tracker: small code simplication
Use std::max() to avoid comparison and turn into 1-liner.
2014-08-10 15:07:30 -04:00
John Scipione
54e2dd7272 Tracker: style fixes
No functional changes intended.
2014-08-10 15:06:34 -04:00
John Scipione
85a2e66cc1 Tracker: Refactor size calc to use a BString
By using a BString we can keep track of the string length instead of
calculating the length after hoping that sprintf() works or doing a
bunch more work to check the return values using either snprintf()
or asprintf(). sprintf() was not bounds checked either. As an added
bonus we no longer have to use an arbitrary 1024 bytes size buffer.

CID 991605
2014-08-10 15:06:34 -04:00
John Scipione
a0db774833 Tracker: Style fixes to WidgetAttributeText
* rename result to outString
* rename str to inString
2014-08-10 15:06:33 -04:00
John Scipione
e6877f10e0 Tracker: Unintentional integer overflow, CID 701977 2014-08-10 15:06:33 -04:00
John Scipione
3748c166be Tracker: Set initial value, CID 609895 2014-08-10 15:06:32 -04:00
John Scipione
b7735c4c02 Tracker: Set initial value, CID 609894 2014-08-10 15:06:32 -04:00
John Scipione
9ead583fb3 Tracker: Set default values, CID 609893 2014-08-10 15:06:31 -04:00
John Scipione
cf2902f4d4 Tracker: Potential, but unlikly NULL dereference 2014-08-10 15:06:31 -04:00
John Scipione
a8216d9fef Tracker: Style fixes to WidgeAttributeText.cpp 2014-08-10 15:06:30 -04:00
John Scipione
95ef540535 Tracker: Unchecked dynamic_cast, CID 611229 2014-08-10 15:06:30 -04:00
John Scipione
a35bd7b065 Tracker: Unchecked dynamic_cast, CID 600452 2014-08-10 15:06:29 -04:00
John Scipione
86c2b955b7 Tracker: Unchecked dynamic_cast, CID 600506 2014-08-10 15:06:28 -04:00
John Scipione
6b51d90211 Tracker: style fixes to FilePanelPriv.cpp 2014-08-10 15:06:28 -04:00
John Scipione
e2ee7b0442 Tracker: Move B_TRANSLATION_CONTEXT to top
of FilePanelPriv.cpp
2014-08-10 15:06:27 -04:00
John Scipione
a76808e72e Tracker: Unchecked dynamic_cast in FilePanelPriv.cpp, CID 300327 2014-08-10 15:06:27 -04:00
John Scipione
e5355e2814 Tracker: Unchecked return values
Check that find_directory() and path.Append() succeeded.
2014-08-10 15:06:26 -04:00
John Scipione
38f3b29c70 Tracker: Check dynamic_cast 2014-08-10 15:06:26 -04:00
John Scipione
f0b515eca1 Tracker: Check dereference NULL pointers
field->Menu() could return NULL, field->Menu()->FindMarked() could return NULL.
2014-08-10 15:06:25 -04:00
John Scipione
8fbb387b1b Tracker: check dynamic_cast 2014-08-10 15:06:25 -04:00
John Scipione
fbf61796ca Tracker: Check dynamic_cast
ASSERT that it is not NULL as it shouldn't be.
2014-08-10 15:06:24 -04:00
John Scipione
a2400cc5ca Tracker: some style fixes to FindPanel 2014-08-10 15:06:24 -04:00
John Scipione
dc28a571c6 Refactor FindPanel::Draw()
Check if pointers are NULL before dereferencing them.
2014-08-10 15:06:23 -04:00
John Scipione
dddea1f72f Tracker: Prefer textControl->Text()
over textControl->TextView()->Text(), also SetText()
2014-08-10 15:06:23 -04:00
John Scipione
73de7ce4ec Tracker: check that textControl->TextView() isn't NULL 2014-08-10 15:06:22 -04:00
John Scipione
a2b0a3c08a Tracker: refactor FindPanel::SetUpAddRemoveButtons()
Instead of passing the box in we can just use FindView to get it,
that's what other methods do. Also, check if removeButton exists
in AddAttrRow() first instead of doing it in this method.
2014-08-10 15:06:22 -04:00
John Scipione
350af1ce3f Tracker: Unchecked dynamic_cast, CID 1210857 2014-08-10 15:06:21 -04:00
John Scipione
e85fa8f787 Tracker: Unchecked dynamic_cast, CID 1210856 2014-08-10 15:06:21 -04:00
John Scipione
ce04484e6b Tracker: Dereference NULL pointer, CID 1032279
Also a bit of a refactor of GetDefaultAttrName(), check for NULL explicitly,
rename result to attrName
2014-08-10 15:06:20 -04:00
John Scipione
861d997e49 Tracker: Unchecked dynamic_cast, CID 1032264
Also some minor refactoring, rename string to textEntryString,
check before dereferencing potentially NULL pointers.
2014-08-10 15:06:20 -04:00
John Scipione
08b7ddae76 Tracker: Unchecked dynamic_cast, CID 1032263 2014-08-10 15:06:19 -04:00
John Scipione
1e09ea53e3 Tracker: Check return values, CID 991051 & CID 991052
The CIDs are about mkdir, we want to check that either the command
succeeded or failed because the directory already exists.

However, we also want to check the return value of find_directory()
and Append() to make sure they succeeded as well.
2014-08-10 15:06:19 -04:00
John Scipione
1995f1a63d Tracker: Check for negative size, CID 610924 2014-08-10 15:06:18 -04:00
John Scipione
1371d18c36 Tracker: Unchecked dynamic_cast, CID 603126 2014-08-10 15:06:18 -04:00
John Scipione
f0eb64b40d Tracker: Unchecked dynamic_cast, CID 603125 2014-08-10 15:06:17 -04:00
John Scipione
404b6d40d3 Tracker: Unchecked dynamic_cast, CID 603123 2014-08-10 15:06:17 -04:00