summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
2018-08-26Fixed typo (meaningfull -> meaningful)Matthias Seidel
Notes: prefer: 9b6062afb325c0396d88fdc80a994ec0ccde4852
2018-08-18Arrays allocated with new [] should be freed using delete[].Don Lewis
Notes: prefer: 3901964b6d1fb2117cb983a7eedf80da93ba5530
2018-07-12Update targets for macOSJim Jagielski
Notes: ignore: aoo
2018-07-12Work on getting macOS building again w/ 4.2.0 and the versioning of libs...Jim Jagielski
what a cluster* Notes: ignore: aoo
2018-05-31Fixed typos:Matthias Seidel
contructor -> constructor convinient -> convenient Notes: prefer: 48f0a5ed3501e0b0a55cc71f85b4d1aee5a9f4ed
2018-04-28Fix potential memory alignment issues on X86_64.Don Lewis
Clang version 4.0 and newer uses SSE instructions that require 16-byte alignment to zero memory allocated using the C++ new operator. The internal memory allocator does not understand anything larger than 8-byte alignment. Modify it to be capable of doing 16-byte alignment when necessary. There is also a debug layer beneath the C++ new and delete operators that is enabled by the --enable-debug configure option. This layer adds 8 to the requested size of any allocations before calling the underlying allocator, adds a known signature to the start of the memory block, and then adds an 8 byte offset to the pointer before returning it to the caller. The delete operator basically does the reverse, checking for the proper signature. Modify this code so that it adds and subtracts a 16-byte offset on X86_64 so that a properly aligned block from the underlying allocator does not cause new to return a misaligned pointer. Modify set_soenv.in so that it always requests 16-byte alignment on X86_64 so that the ABI is the same independent of the toolchain. Notes: prefer: cfd2691e5bf398304d7816227b933e53907b6204
2018-03-06Port the "kill" command and some useful partsDamjan Jovanovic
of the Windows API wrapper "uwinapi" to AMD64. We aren't going to rewrite it in AMD64 assembly as most of the uwinapi thunked/emulated functions are very old, and AMD64 only came out in the Windows XP and Windows 2003 era, so only function not available on those versions of Windows such as SHCreateItemFromParsingName and (unbelievably!!) snprintf and co need to be ported. And I've used C code instead of assembly as it's clearer and performance isn't that important nowdays. Patch by: me Notes: ignore: aoo
2018-03-05Fix use of ::std::min and ::std::maxDamjan Jovanovic
on types of different sizes. Patch by: me Notes: prefer: 7e86fc3fe72f67b0d9240b4afad28c66dc482c80
2018-03-05Add some initial fixes for Win64 in main/sal.Damjan Jovanovic
Patch by: me Notes: prefer: 7e86fc3fe72f67b0d9240b4afad28c66dc482c80
2017-12-28#i126518# OS/2 link with system libcx0 to use new exception and memory ↵Yuri Dario
mapping handling. Notes: ignore: obsolete
2017-03-07Revert r1719566 and bringing back some casts.Pedro Giffuni
CERT C coding standard seem to have changed its mind. MEM02-A. Do not cast the return value from malloc(). has been superceeded by: MEM02-C. Immediately cast the result of a memory allocation function call into a pointer to the allocated type. Notes: ignore: aoo
2017-02-25i101100 - Fix some aliasing issues.Pedro Giffuni
Undo unnecessary change from r1782205: using a union in oslSocketAddrImpl just makes the code more complex and doesn't improve aliasing. Notes: ignore: aoo
2017-02-08i101100 - Fix some aliasing issues.Pedro Giffuni
This is a very small part of a patch submitted by Caolan McNamara on 2009 to help OOo work with -fstrict-aliasing. It is not complete and for now I omitted adding -fno-strict-aliasing to many makefiles. This does require a lot more attention and will have to be completed at some point because newer versions of GCC enable strict-aliasing with most optimization levels. Notes: prefer: 11513ddf5b05cb7b3c1e91f9728159b9be3a5da2
2017-02-07Add initial support for building AOO with Clang on Linux.Damjan Jovanovic
This allows Ubuntu 16.04 to compile AOO with Clang 1.8 on an x86. Other architectures probably don't work, as Clang 1.8 is pretty strict about the low-level C++ ABI hacks in main/bridges, but at least they should fail early in main/bridges instead of the previous behaviour, where main/bridges compiles nothing when "$(COM)" != "GCC" and main/i18npool then fails with a mysterious "error: cannot get uno environments" message. Patch by: me Notes: prefer: bf1f0183d5c6b4c94acdbee27276d5a386a657f4
2017-01-31The clear_001 QA test fails sporadically with a 7 nSec mutex hold timeDon Lewis
measurement. The nominal hold time for the mutex is 5 seconds, but because the mutex state is polled at 1 second intervals, the actual measured time will probably be 6+ seconds. If the nanoseconds field of the starting timestamp is large, it is possible that it will have wrapped to a small value at the poll time when the mutex is detected as having been released. If the time interval was calculated at full precision by subtracting both the seconds and nanoseconds fields of the before and after timestamps, an interval of just over 6 seconds could look like 7 seconds and a large negative number of nanoseconds. Since this test only subtracts the seconds field, it can think the difference is 7 seconds and fail the "nSec < 7" assertion. As a quick fix, change the assertion to "nSec <= 7". Notes: reject: seems to work for us
2017-01-16osl_diagnose_backtrace_Impl(): leave a default value for FreeBSD.Pedro Giffuni
Thinking of a future ARM support that may want to give some value to FRAME_PTR_OFFSET and FRAME_OFFSET. Notes: ignore: obsolete
2017-01-13FreeBSD PPC: Missing patchPedro Giffuni
Submitted by: Curtis Hamilton Notes: merged as: 5f2f0d9799d9ab57624e03e235b32333ad961ac2
2016-12-24Add some "Revision" svn keywords.Pedro Giffuni
Revisions were used within the tree, perhaps inherited by previous CVS/Subversion usage. Re-use them now since we have been lazy about updating them manually and because they can be useful for bug reports. Notes: ignore: obsolete
2016-12-22Re-enable some Id svn:keywords.Pedro Giffuni
Most of these pre-existed in the code for some reason. New Id keywords were only added in these files: main/solenv/inc/minor.mk main/vcl/unx/kde4/KDEXLib.cxx The latter two are important as the keep release information and we want to keep a reference when new versions are bumped. While here update the information for KDE. Notes: ignore: aoo
2016-12-08Update endianness detection on FreeBSD.Pedro Giffuni
This produces a working AOO on FreeBSD PowerPC64! This is related to i126615 which was also fixed by Curtis a while ago. Kudos for both contributions, makes me want to get a PowerPC to run FreeBSD + AOO on it! Author: Curtis Hamilton -- cmhamilto at gmail Notes: reject: wont apply
2016-09-03In the SAL_UNUSED macro, __attribute((__unused__)) should beDon Lewis
__attribute__((__unused__)), but both clang and gcc seem to understand both. Since __attribute__((__unused__)) can preceed the variable name, just like __pragma(warning(suppress:4100;suppress:4101)) for Visual Studio, so de-parameterize the SAL_UNUSED macro. Gcc whines if __attribute__((__unused__)) is used for a struct member, so create a separate define, SAL_UNUSED_MEMBER, which is empty for gcc, to handle struct members. Notes: prefer: 7c704c78d3c652504c064b4ac7af55a2c1ee49bb
2016-09-02Fix improper usage of strncat() and snprintf(). Flagged by -Wstrncat-sizeDon Lewis
compiler warning from clang. Notes: prefer: 067dd53523ecf2c5a6343c6f5b84e4074d9e9a7d
2016-09-01Fix -Wunused-private-field errors in sc/inc/compiler.hxx. The structureDon Lewis
ScDoubleRawToken contains four unused private fields. Mark these as unused to eliminate the warning message. We can't delete these fields because we want the layout of this structure to match ScRawToken. Notes: prefer: d6500b19afc6a15e63e679765317690eac0d4207
2016-05-22Spelling, spelling ...Pedro Giffuni
Why worry about some sprinkled German when we haven't yet learned English. Notes: prefer: b37a07f2da6c4fcc1a01cc3ea547c558c23edd71
2016-04-10Replace 0 with NULL for pointers.Pedro Giffuni
Only applied to C code: common style for C++ is different. Found with coccinelle: http://coccinelle.lip6.fr/ Notes: prefer: 5bbdb9423e15b68438bb8397c15635e044129e28
2016-04-10Drop redundant parenthesis.Pedro Giffuni
Found with coccinelle: http://coccinelle.lip6.fr/ Currently only applied to C code. Notes: merged as: 429a15cc292a92c2f00be6febde7da66ed792b70
2016-03-25#i126890# code: compiling with recent clang generates thousands of infinite-recuDon Lewis
rsion warnings about DbgOut() If the definition of the overloaded function DbgOut() in sal/inc/rtl/string.hxx is compiled without having first compiling the the declaration of DbgOut() with a different signature in tools/inc/tools/debug.hxx, the compiler thinks DbgOut() is calling itself recursively with no means of escape. Fix this in the case where DBG_UTIL is defined by including <tools/debug.hxx> inside string.hxx so that the compiler will encounter the declaration of DbgOut() in debug.hxx first in this case. This requires adding a couple of directories to the compiler include path so that the new consumers of <tools/debug.hxx> can find it as well as one of its dependencies. If DBG_UTIL is not defined, then debug.hxx does not declare DbgOut(), so fix this case by hiding the DbgOut() definition in string.hxx behind #ifdef DBG_UTIL since it won't be used in this case. Notes: reject: sal depending on tools is *insane*
2016-02-06Platforms that need CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT for sockets usuallyDamjan Jovanovic
need it for pipes too, and even if it isn't necessary it can't hurt. In particular, on FreeBSD 11-CURRENT it seems pipes no longer wake up from accept when closed in other threads, so let's deal with that before FreeBSD 11 is released. Reported by: Matthias Apitz <g u r u a t u n i x a r e a d o t d e> Patch by: me Tested by: Matthias Apitz <g u r u a t u n i x a r e a d o t d e> Notes: merged as: ed983eb5ce71d0b9af07795eabd8686f24c4597e
2016-01-29Remove an unused empty file that is causing the RAT scan to fail.Damjan Jovanovic
Patch by: me Notes: ignore: aoo
2016-01-28#i126787# fix unit tests on WindowsDamjan Jovanovic
Fix a regression caused by r1710853 and which always existed in some files, where <prewin.h> and <postwin.h> were being included before and after <windows.h>, yet unavailable as the tools module isn't built (and can't be) before sal. Patch by: j.nitschke at ok.de Review by: me Notes: ignore: obsolete
2015-12-19Remember to NULL terminate when using strncpy.Pedro Giffuni
All systems should have strlcpy. Notes: prefer: 8f210c26c53cf5480819d983e57977d531422ff1
2015-12-13Use %tx to print ptrdiff_t.Damjan Jovanovic
Patch by: me Notes: merged as: cfe08df695c046371c4361a434176e6381e3e064
2015-12-13Use %p to print pointers in sal backtraces instead of 0x%x + conversion to ↵Damjan Jovanovic
integer. Patch by: me Notes: merged as: 66add63dda22321476653d06a61bc61090fafc58
2015-12-11Drop useless malloc casts in C codePedro Giffuni
In ANSI C these casts are unnecessary and can hide warnings. If this code is moved to C++ we may need such casts back but we may then consider re-writing the allocation code altogether. Notes: prefer: b15b51b76997c5b4cce5fa3d70df99acc1a5439a
2015-12-03Missing UnlockPedro Giffuni
Condition broadcast failed but silently try to unlock the mutex. CID: 705120 Notes: prefer: 914018c03a492f433e1ae5081aa3184cded9783f
2015-12-02Off by one using readlink(2)Pedro Giffuni
CID 705623, 982797 Notes: prefer: 95f8cb6823f21dd97b380136286e87e0ffa2fb24
2015-11-30Destination buffer too smallPedro Giffuni
CID: 706154 Notes: prefer: 8f210c26c53cf5480819d983e57977d531422ff1
2015-11-27Use the ptrdiff_t printf format code for backtracing on FreeBSD.Damjan Jovanovic
Patch by: me Notes: merged as: 7a93f5348007ab1ce52e65cd3811032f31839689
2015-11-26Implement osl_diagnose_backtrace_Impl() on FreeBSD. Also fix the value of ↵Damjan Jovanovic
FRAME_PTR_OFFSET in both backtrace.c and diagnose.c - it's 3 because of the EBP/RBP register's position in the jmp_buf (https://github.com/freebsd/freebsd/blob/master/lib/libc/amd64/gen/_setjmp.S and https://github.com/freebsd/freebsd/blob/master/lib/libc/i386/gen/_setjmp.S). This gets backtracing to fully work on FreeBSD. Patch by: me Notes: merged as: fa326746ba70b0302f11533a5cf36daaa6235d04
2015-11-26Fix the stack frame layout for backtraces on FreeBSD.Damjan Jovanovic
Patch by: me Notes: merged as: a1a8aa8ef80066dd2fbabbf136dde874c864db8b
2015-11-25i66807 - Fix GCC warning in backtrace.cPedro Giffuni
The Bugzilla issue has another fix for sparc but I have no way ot test it. Notes: merged as: 0bd3aa40f5095e13d10f73076d8528178d146664
2015-11-24Resource leakPedro Giffuni
CID: 1028069 Notes: prefer: c04fde0063276e3d5a6de3e077c1c822ed1ad25e
2015-11-15Fix a main/sal/qa/osl/mutex build error on MacOS.Damjan Jovanovic
Found by: Pathangi Janardhanan Jatinshravan <JATINSHR001 at e dot ntu dot edu dot sg> Patch by: Pathangi Janardhanan Jatinshravan <JATINSHR001 at e dot ntu dot edu dot sg> Review by: me Notes: prefer: 8f823b7d39154d2044e08174a858f8ef357a151a
2015-10-27Don't build/run the main/sal/qa/rtl/process test which doesn't always link andDamjan Jovanovic
breaks the build. Notes: ignore: obsolete
2015-10-27Fix some main/sal unit tests on Windows, remove unneeded OOO_SUBSEQUENT_TESTS,Damjan Jovanovic
and run all that pass during the build. Notes: ignore: obsolete
2015-10-27Remove unnecessary OOO_SUBSEQUENT_TESTS from main/sal/qa/ByteSequenceDamjan Jovanovic
and main/sal/qa/OStringBuffer. Notes: ignore: obsolete
2015-10-20#i125194# Fix RC2 issue by changing approach.Andrea Pescetti
Patch by: Giuseppe Castagno Notes: prefer: b49a2f7373e950efc3fe11b89309313ac69c1e1f
2015-10-17#i126582# Prevent errors with read/only shares on Sharepoint.Andrea Pescetti
Patch by: Giuseppe Castagno Added a Windows API missing error: ERROR_CANT_ACCESS_FILE file cannot be accessed by the system. Notes: prefer: b49a2f7373e950efc3fe11b89309313ac69c1e1f
2015-10-13#i126586# don't break on non-Linux non-FreeBSD non-NetBSD *nix systems ...Damjan Jovanovic
Notes: prefer: 309aa845a8e413519d634680aff112a3567e2e61
2015-10-13#i126586# FreeBSD automation deadlock: osl_closeSocket() doesn't wake up ↵Damjan Jovanovic
thread stuck in accept(). Generalize the "#if defined(LINUX)" workarounds to the *BSDs. Notes: merged as: 309aa845a8e413519d634680aff112a3567e2e61