Commit Graph

62332 Commits

Author SHA1 Message Date
Murai Takashi
7dec2bff46 bus_managers/firewire: Fix array index out of bounds
if found = 3 at line 200, gFirewire_softc[] index is out of bounds
at line 193, and may be at line 243.
Pointed out by cppcheck.

Change-Id: I0568c503e6edea8f78e0da402271b669ba786def
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3502
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-15 12:02:19 +00:00
X512
ebe6011c58 app_server: do not flush back buffer outside of clipping
Introduce DrawTransaction that automatically hide/show floating overlays
and flush back buffer.

Fixes #15574.

Change-Id: I30088b74fc66cfcd5b2b433b34141e7d496f68a1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3496
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-12-15 12:00:12 +00:00
Murai Takashi
799e367afd audio/usb: Fix for condition
Pointed out by cppcheck.

Change-Id: Ief24915908bbab41955924279847ba56faa12b09
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3506
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-14 11:18:27 +00:00
X512
cdccd323b5 use common AutoDeleter types
Change-Id: I115e14b76f3ff049c5f7d9471efd3619a0038fcf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3483
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-12-13 19:14:13 +00:00
X512
47404f12f2 accelerant: replace AreaCloner with AreaDeleter
Reduce code duplication.

Change-Id: Ice1a14fc7378382e89c3e5a1aea6fa21b903e436
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3482
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-12-13 19:14:13 +00:00
X512
553f3f2309 AutoDeleter: add delarations for common types and destructors
Change-Id: I74b75a54038d5af370696302f33b5c0abab4820c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3481
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-13 19:14:13 +00:00
X512
84b1893b73 AutoDeleter: introduce HandleDeleter
It allow to use arbitrary handle type, null value and destructor function.

Change-Id: I87c444cb7ef1b08d1dbed7fe4171700171d651d2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2977
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-12-13 19:14:13 +00:00
Anarchos
74b6097078 sd/mmc: read, naive method
First implementation of reading sectors from an SD card.
This is not the best performance for many reasons:
- No DMA
- Reads only one sector at a time
- Cannot read more than 512 bytes per syscall

Also there are major limitations:
- Cannot read less than 512 bytes. The hardware of course works in full
  sectors. The mmc_disk driver should go through the io scheduler to
  make sure requests have a reasonable size and offset, and nothing
  tries to read just a few bytes in the middle of a sector.
- SD cards only (no SDHC, no MMC)

Architecture problems:
I think too much of the implementation is done in sdhci_pci and should
be moved to the upper layers. However it is difficult to say without
having implemented DMA (which indeed will be at the low level of the
sdhci controller). It doesn't help that the order of operations is a
bit different depending on wether there is DMA or not. In DMA mode you
first prepare the buffer, then run the command. In non-DMA mode you
first send the command, then read the data into the buffer. We need an
API at the mmc_bus level that doesn't care about that low-level detail.
There are other things that the MMC bus should be doing however, such
as switching to different clock speeds depending on which card is
activated and how fast it can go.

At least the following should be done:
- The read method for mmc_bus and sdhci_pci should use a scatter-gather
structure as a parameter instead of a single buffer
- See if can be integrated into ExecuteCommand at sdhci level (it's
essentially a command with an additional data phase)

Change-Id: I688b6c694561074535c9c0c2545f06dc04b06e7d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3466
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-13 18:56:19 +00:00
Adrien Destugues
f6d7f9f599 sdhci_pci: Remove DumpRegisters function
Reading registers can change the state of the device, so we can't do
this as a generic debug function. We'll have to more carefully decide
which registers to dump in which case.

Change-Id: I4a706b749a0dd2f4f0e29b602b90354fbf6d66f8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3465
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-13 18:56:19 +00:00
Adrien Destugues
eb92a83453 sd/mmc: fix warnings
Change-Id: I5d0c95240cd5594b0f8090f5ec7b3f6ee181dacc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3464
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-13 18:56:19 +00:00
Adrien Destugues
f7c1481c00 sd/mmc: update documentation
- add info about qemu debugging features
- update qemu command line to current syntax
- add some extra options to make things easier
- remove list of files (directories are enough) and instead add a short description of each module.

Change-Id: Ie9980d8143c33655147f161b248c45689ba82476
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3463
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-13 18:56:19 +00:00
Adrien Destugues
e46898932c Initial work for the mmc_disk driver
No read and write support for now. But we implement getting SD card
capacity. SDHC is not supported yet (it uses a different layout for the
CSD register which will be rejected by this version of the code)

Change-Id: Ife844a62f3846c0a780259e9a3a08195e2fd965e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1068
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-13 18:56:19 +00:00
Murai Takashi
b66b01c283 bin/bfs_tools: Fix array index is out of bounds
If length == BPLUSTREE_MAX_KEY_LENGTH at line 237,
buffer[] index may be out of bounds at line 245.
Pointed out by cppcheck.

Change-Id: Ib86abeaa72526b327af85ca9a26b050834f5a2c9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3501
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-13 16:44:30 +00:00
Andrew Lindesay
5b1ae51c6b HaikuDepot: Memory Leak Fix
Change-Id: Ibd311d10009484ba834843149740c5a11f283202
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3500
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2020-12-13 10:07:22 +00:00
Murai Takashi
37cd311852 ICNSTranslator: Fix same expression used in consecutive assignments
Fix same expression (imageTypeInfo.iconWidth) is used in consecutive
assignments of 'iconWidth' and 'iconHeight' at line 191, 192.
Pointed out by cppcheck.

Change-Id: I251a4b8e6c83f86aad4fa0030ebc362f3b97fb0e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3499
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-12 13:54:12 +00:00
Murai Takashi
c3427db750 audio/null: Fix null pointer dereference
Fix possible null pointer dereference at line 350-354
when 'device' is NULL at line 347.
Pointed out by cppcheck.

Change-Id: I25a090172a0d17ef3cb1fe607f70a31e579d13b0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3498
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-12 13:53:56 +00:00
Sean Long
151de9ff9b BHandler documentation: Fix typo
Change-Id: Ia533d028163248f37ff3c92a8aa981d28b47e34c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3497
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-12 08:55:41 +00:00
Autocomitter
7c8377101f Update translations from Pootle 2020-12-12 08:45:25 +00:00
Jérôme Duval
116794af63 ipv4: reenable multicast
tested between two Haiku VMs with iperf.

Change-Id: Id9d3865f2c9f8ed6c79d0ece53f51c781c77b771
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3453
Reviewed-by: Rene Gollent <rene@gollent.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-11 11:45:46 +00:00
Pawan Wadhwani
3e4b663667 Updated Readme.Compiling.md according to hrev54611
Updated commands to compile build tools

fixes #16566

Change-Id: I3ef4d253dc45e0bb92e4c13164c7fac2127a5a94
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3495
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-11 11:45:12 +00:00
Murai Takashi
6182c5ad27 fontdemo: Fix null pointer dereference
Fix possible null pointer dereference at line 314
when 'submenu' is NULL at line 297.
Pointed out by cppcheck.

Change-Id: I054f63d574f4a9608df49d48ee74b87cd0116f69
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3492
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-11 08:55:35 +00:00
Adrien Destugues
5b627acb33 Build fix.
Desynchronisation between fs_shell and normal autodeleter files
2020-12-10 18:01:22 +01:00
Murai Takashi
efc042ff48 Window: Fix dead assignment
Fix value stored to 'maxWidth' or 'maxHeight' is never read
when maxWidth > fMaxWidth or maxHeight > fMaxHeight.
Pointed out by Clang Static Analyzer.

Change-Id: I2bd0b8712d47e64298c0f915f24f7f1c87f4362e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3474
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-10 11:40:20 +00:00
X512
6467297a1b simplify AutoDeleter code by using typedef
Change-Id: I726c3aee794b91ed51970853db3921d17a5f795e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3462
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-10 11:39:49 +00:00
X512
36aafa560b fix build after CObjectDeleter interface change
Change-Id: I76e217abcd13c22c4d68170e07333cdde4d7a891
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3461
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-10 11:39:49 +00:00
X512
71e79db9b8 fix build after AutoDeleter change
Change-Id: Id6ffc8d58821159b1d570bf5ac17d8347d88f7f5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3459
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-10 11:39:49 +00:00
X512
76ab85671d AutoDeleter: fix AutoDeleter size
C++ don't allow zero size class fields. If field with empty class field
is used, it's size will be 1 byte.

Create DeleteFunc instance as local variable at each use instead.

Fixes #16638.

Change-Id: Ifb76c45ea02e9fed014751542ee5f16f41e11d15
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3458
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-10 11:39:49 +00:00
X512
ab57ee42cb fix build after MethodDeleter interface change
Change-Id: Iadb9e37772fd6588636085944c1455249ac0f926
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3457
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-10 11:39:49 +00:00
X512
aecba91311 AutoDeleter: move destructor function in MethodDeleter from constructor to template argument
The same as CObjectDeleter.

Change-Id: I85c4cb3635f01f13e529ca087324cc2fcb42cfc0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3456
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-10 11:39:49 +00:00
X512
7d775e7925 AutoDeleter: move destructor function in CObjectDeleter from constructor to template argument
It allows to make typedef of pointer types and declaring pointers in headers.

Store of destructor function pointer in CObjectDeleter is no longer needed.

Change-Id: Ic629fd10b28b09f4190edf8ba6b911ca3108ab0e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3455
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-10 11:39:49 +00:00
Augustin Cavalier
6f243905bf kernel: Allow usage of magic team constants in create_area_etc.
All other functions that support these handle them specifically,
so vm_create_anonymous_area must do so as well.

Change-Id: I7233770926b718936baeff10ef73668ac15c5201
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3477
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-10 03:04:52 +00:00
Adrien Destugues
369abf3be4 Have a minimum size for scrollbars
With small font sizes, the scrollbars don't need to get smaller than 14
pixels. So, don't allow the scaling to go below 1.
2020-12-09 21:57:31 +01:00
Murai Takashi
b9e10b0796 Expander: Fix dead nested assignment
Fix value stored to 'status' is never read.
Pointed out by Clang Static Analyzer.

Change-Id: I0bbeafb74168d566128b53f8ad40e71218c78c45
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3473
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-09 20:38:41 +00:00
Adrien Destugues
5d1042057b Add Noto Sans Symbols2 to font fallbacks
Also use the correct symbol for the return key (we were using another
similar arrow because this one was not available in DejaVu Sans).

Fixes #14034.

Note that build/jam/repositories/HaikuPorts ships an old version of the
Noto package that does not include the Symbols2 font. It should be
updated. Adding this to the pile of lagging behind packages, alongside
icu, mawk/gawk, and tnftp. Can anyone take care of it?
2020-12-09 20:00:26 +01:00
Murai Takashi
2c08d25325 bin/media_client: Fix memory leak
Fix leak of memory allocated to 'app'.
Pointed out by Clang Static Analyzer.

Change-Id: I59d39b76a18893bd284db1d75e40620bb1aee9e2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3480
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-12-09 16:12:43 +00:00
Jérôme Duval
65b3fe452a GameKit: give up default template parameter for gcc2 2020-12-08 15:46:55 +01:00
Murai Takashi
2db8ba2c8d Menu: Fix dead store
Fix value stored to 'flags' is never read.
Pointed out by Clang Static Analyzer.

Change-Id: Ia154fbdd4dd5fb10716cf9079625ca65e2f58122
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3472
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-08 13:46:51 +00:00
Jérôme Duval
6336b86ab8 GameKit: gcc2 build fix 2020-12-08 14:39:56 +01:00
Máximo Castañeda
fb6ee7844d GameSoundBuffer: avoid buffer copy
Change-Id: Ibffe80ebe5e8205e853e09b6ebb9ba65b53d83e7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3475
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-08 12:33:22 +00:00
Máximo Castañeda
cfe72209cf U8 sound format
U8 sound has a nonzero value as its zero amplitude, so it needs to be
special-cased when mixing, applying gains and other transformations.

Change-Id: I5ad96b5f39d454bffad2449ac9f27b2ae61e2ccd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3470
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-08 12:33:22 +00:00
Murai Takashi
6cd9975b85 bin/keymap: Fix memory leak
Fix leak of memory allocated to 'app'.
Pointed out by Clang Static Analyzer.

Change-Id: I2cbd005d42d4747937ee4b6e12ccf409f122ea24
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3478
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-08 12:27:40 +00:00
Máximo Castañeda
8e9d64f0d6 FileGameSound: fix stuck in pause when ramped
Change-Id: I346d7b93fa8507451ee46856ad6618acd6e2d609
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3469
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-08 04:32:56 +00:00
Máximo Castañeda
15de111dcf FileGameSound: fix buffer advance accounting
Change-Id: I15bb2b1e703cad955544a1151adc6a1277b077a8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3467
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-08 04:32:56 +00:00
Alexander von Gluck IV
9293eadbda opengl/glinfo: Fix broken GLinfo app
* Can't call InfoView() with an unlocked BGLView.
* If unable to obtain to glGetString, show some "unknown" messages

Change-Id: I17d8ff84feed166644d54b0e19e0ef1fce202a74
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3476
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-08 00:25:45 +00:00
Alexander von Gluck IV
9adc70887e efi: Call console-control to enter text mode
Change-Id: Ife1df3415bc5a31801bcb3d925f1b7c3a105f51b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2250
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-07 11:32:28 +00:00
Máximo Castañeda
8eafd6cd04 GameKit: use more than 1 sec precision ramping
Change-Id: I015f116239fad5dd48f7f4509db503dc8f60c0d0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3468
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-06 18:17:55 +00:00
Augustin Cavalier
10bc5b6e2f Tracker: Increase the readability threshhold to 50%.
nephele is working a more comprehensive fix to this code, but for now,
this seems to be sufficient for the time being.
2020-12-05 15:23:14 -05:00
Autocomitter
e46d640063 Update translations from Pootle 2020-12-05 08:43:08 +00:00
Lt-Henry
e6bb814359 acpi_thermal: some style corrections
Change-Id: I7194be3b284e2de839afb53037b26fc691984dd7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3442
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-04 07:29:11 +00:00
Lt-Henry
3d0f2eea4f acpi_thermal: get the driver working
Change-Id: Ib0b7de56ef35092da93cc5fa61bdf0cfef41c042
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3440
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-04 07:29:11 +00:00