Commit Graph

37955 Commits

Author SHA1 Message Date
Ryan Leavengood
5b9003c79e CID 5899: Move a variable so it does not go out of scope when a pointer to it
is used. In my testing this did not seem to be a problem but it doesn't hurt to
fix it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40012 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-29 05:34:50 +00:00
Ryan Leavengood
ccb228004c CID 6931 and 8076: use strncpy for the extremely unlikely case that
B_TRANSLATE("???") returns something larger than the size of name.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40011 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-29 05:16:42 +00:00
Ryan Leavengood
5d67e2ba05 CID 10412: remove assignments for unused variables.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40010 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-29 04:53:05 +00:00
Ryan Leavengood
9617074c9b CID 5273: Don't hide the message parameter with a local variable. Not critical
but good coding practice.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40009 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-29 04:26:32 +00:00
Ryan Leavengood
43d3fdf3b1 CID 6925: Use snprintf. Also sizeof(size) is kind of funny.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40008 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-29 04:20:39 +00:00
Ryan Leavengood
39aa9ae199 CID 2393: Check the return value of GetDecoratorSettings (though this is
probably not needed.)

Another problem fixed here is that the border width value is in "border width"
not "border" so this code wasn't really working before.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40007 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-29 04:15:14 +00:00
Ryan Leavengood
7058291b1a CID 6924: Use safe coding practices to avoid buffer overflow.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40006 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-29 04:00:25 +00:00
Ryan Leavengood
7f6caa088c CID 5772: Delete the unneeded (and leaked) ref on the loop end case.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40005 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-29 03:54:07 +00:00
Ryan Leavengood
97d3d5a1d3 CID 9936: Uninitialized members.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40004 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-29 03:47:21 +00:00
Michael Lotz
8e164a0fe2 Add way to add a "minimal" bitmap without colorspace/flags for adding multiple
similar bitmaps.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40003 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 22:17:28 +00:00
Michael Lotz
645e9fe135 Cleanup which should've been part of r39972.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40002 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 22:12:13 +00:00
Michael Pfeiffer
05a2fec5fb * CID 9729: initialized member fPrinter in constructor.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40001 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 22:11:02 +00:00
Michael Lotz
1c3680d302 Allow creating a BitmapDrawingEngine with a specific colorspace.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40000 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 22:08:46 +00:00
Michael Pfeiffer
0f0bd984d7 * CID 6544, 5645: removed "const" qualifier on return type
as it is meaningless


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 22:08:04 +00:00
François Revol
b44f0a94a4 Add commented setting to enable the laplink type debugging output module.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39998 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 22:01:19 +00:00
François Revol
3d5a11ee4e 44100 kHz seems a lot for audio sampling rate...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39997 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 21:51:33 +00:00
Michael Pfeiffer
9dbc17e4f3 * CID 10346: hid unused code; I cannot remember why the
code is not used; maybe it was not implemented completly
  or BePDF could not render it correctly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39996 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 21:44:59 +00:00
Michael Pfeiffer
737e45854e * As pointed out by Rene the buffer size in snprintf
includes the 0-terminator.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39995 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 21:24:58 +00:00
Michael Pfeiffer
fdee209b00 * CID 10260: member variable fIconSize was not initialized
in error case.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39994 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 21:14:25 +00:00
Michael Pfeiffer
a17b8132ed * CID 10260: member variable fDefaultPrinter was not
initialized in constructor in error case


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39993 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 21:12:17 +00:00
Michael Pfeiffer
e923359460 * CID 7969: defensive programming: use snprintf instead of sprintf.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39992 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 21:06:29 +00:00
Michael Pfeiffer
0f73490879 * CID 5322: renamed parameter to "transportPath" to
not hide parameter "path".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39991 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 20:53:11 +00:00
Michael Pfeiffer
1f8d90053a * CID7947 avoid buffer overflow (very unlikely;
should have happened only if the translated text was very large).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39990 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 20:49:01 +00:00
Michael Lotz
2baa527f82 CID 3221: Add missing break.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39989 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 19:08:37 +00:00
Michael Lotz
2d5c8bdea3 CID 10552: Fix double free in error case.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39988 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 18:55:00 +00:00
Fredrik Holmqvist
7f83c5cd84 No need to use loadAddress as delta as delta isn't used for i==0. CID3197, CID 1972 and ticket #6990.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39987 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 17:04:58 +00:00
Michael Lotz
5c3457dd22 CID 7961: Use snprintf with proper sizes to make sure nothing overflows.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39986 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 16:52:29 +00:00
Michael Lotz
edcbc5b0e3 CID 5889: The bytes array was leaked.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39985 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 16:44:24 +00:00
Michael Lotz
5327be44ec Remove unused members. Also resolves CID 10230 that complained about them not
being initialized.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39984 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 16:22:29 +00:00
Michael Lotz
aa8219391f Someone forgot to initialize fUpdate15 and fColor15 when adding 15bit color
support some 7 years ago...
CID 10246, 10245, 10244, 9471, 9454 and 9453 all concerning that (in the
different constructors / assignements).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39983 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 15:59:07 +00:00
Fredrik Holmqvist
14a12acc76 Only close device if it's a valid fd. CID 3466.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39982 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 15:55:57 +00:00
Stefano Ceccherini
b2f1b918ed empty the message before reusing it, otherwise the pictures will be archived multiple times. Should fix ticket #7035.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39981 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 13:05:23 +00:00
Michael Lotz
8e165582f1 CID 10229: fDraggingMessage was not initialized, potentially sending out drag
messages where there shouldn't have been any.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39980 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 13:04:43 +00:00
Michael Lotz
d65593aaa3 CID 1420: fTargetScreen was leaked.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39979 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 12:59:14 +00:00
Michael Lotz
673481f371 CID 2502: Check the FindMessage return which also safes a needless FindRect call
in the error case.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39978 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 12:55:19 +00:00
Michael Lotz
951366c59d CID 10231: Remove unused fInputPort member and initilize fShutdownCount, even
though it's used only in the special case of running as BApplication.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39977 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 12:47:22 +00:00
Fredrik Holmqvist
2a74e90028 If fileDescriptor is not retrieved don't close it, and if firmwareFileSize is negative fail. CID 3493 CID CID 3494.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39976 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 12:34:16 +00:00
Fredrik Holmqvist
ec349ca3bb If there is an error opening the file (negative id) there is no need for close. CID 3474.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39975 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 11:59:34 +00:00
Fredrik Holmqvist
3c0241d8b5 While the functions didn't use the delta for i==0 accessing arrays at [0 - 1] can't be good.
CID 3197. 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39974 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 11:23:40 +00:00
Fredrik Holmqvist
2f32c12f37 Delete the array after deleting the items in the array. CID 2980.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39973 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 10:46:42 +00:00
Michael Lotz
56c393e396 Cleanup, no functional change intended. Style, line length, early returns,
variable names, added TODO, variable declaration on first use, simplify some
code, add missing sanity checks...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39972 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 02:05:35 +00:00
Michael Lotz
25702ce874 * Use std::nothrow and check the bitmap/cursor allocations.
* CID 2500 and 2501: Check the BMessage::FindData() returns.
* Defensive programming: Take the bitmap/cursor BitsLength() into account when
  copying the data back.
* Some style cleanup, automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39971 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 01:19:47 +00:00
Michael Lotz
83e36298a5 CID 2977: Use the array delete operator.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39970 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 01:00:27 +00:00
Michael Lotz
174a961e22 CID 5885: Resource leak in error case.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39969 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 00:55:17 +00:00
Fredrik Holmqvist
b750229b00 Don't include sys/system.h. This avoids header recursions (the header guards kept us safe). CID 4865, CID 4894.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39968 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-27 22:18:30 +00:00
Fredrik Holmqvist
43687843cc Just for clarity. Renamed parameter from path to dirpath to so it's not hidden by path variable. CID 5272.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39967 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-27 21:17:20 +00:00
Fredrik Holmqvist
31474ccaa0 More of the same.
Postfix/prefix increment evaluation order is not changed by parantheses. Use '+ 1' for readability instead. CID 2982.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39966 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-27 20:47:27 +00:00
Fredrik Holmqvist
0ef0a587b6 Postfix/prefix increment evaluation order is not changed by parantheses. Use '+ 1' for readability instead. CID 2983.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39965 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-27 20:40:30 +00:00
Fredrik Holmqvist
e4fbd1171c Removing get_parent_node call from acpi_enumerate_child_devices.
Afaict it looks like it results in unbalanced Acquire calls on the parent. CID 10393.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39964 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-27 17:11:40 +00:00
Fredrik Holmqvist
b44c75c5eb Modified acpi namespace driver to match ring_buffer functions.
A bit confused about the signedness handling in ring_buffer internals though, int32 to size_t.

Unnested the acpi_namespace_read function a bit and removed dead check for negative lengths from read. CID 4093.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39963 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-27 16:17:54 +00:00