diff options
author | Arnaud Versini <arnaud.versini@gmail.com> | 2012-12-08 11:35:00 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-12-17 18:28:36 +0100 |
commit | 542ad7f1c5ac7794c42248ac13e9b33f84888490 (patch) | |
tree | eeaeefe5e2743c1c815e66103bc36cb90cd758db | |
parent | 34e79c19babc0e6cc281025b40635b91dca444f3 (diff) |
API CHANGE: Remove useless deprecated rtl/memory.h
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, adapted some function
definitions in sal/osl/all/compat.cxx to avoid "must return a value" warnings.
Change-Id: Iac156b004464018225bbfda24f0a234f9ebcb19f
-rw-r--r-- | sal/Library_sal.mk | 1 | ||||
-rw-r--r-- | sal/Package_inc.mk | 1 | ||||
-rw-r--r-- | sal/inc/rtl/memory.h | 53 | ||||
-rw-r--r-- | sal/osl/all/compat.cxx | 32 | ||||
-rw-r--r-- | sal/rtl/source/memory.cxx | 55 |
5 files changed, 32 insertions, 110 deletions
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index 5ea6b55e95f0..cae82192ad0b 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk | |||
@@ -119,7 +119,6 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ | |||
119 | sal/rtl/source/locale \ | 119 | sal/rtl/source/locale \ |
120 | sal/rtl/source/logfile \ | 120 | sal/rtl/source/logfile \ |
121 | sal/rtl/source/math \ | 121 | sal/rtl/source/math \ |
122 | sal/rtl/source/memory \ | ||
123 | sal/rtl/source/random \ | 122 | sal/rtl/source/random \ |
124 | sal/rtl/source/rtl_process \ | 123 | sal/rtl/source/rtl_process \ |
125 | sal/rtl/source/strbuf \ | 124 | sal/rtl/source/strbuf \ |
diff --git a/sal/Package_inc.mk b/sal/Package_inc.mk index 425db1d05514..15fb47717d35 100644 --- a/sal/Package_inc.mk +++ b/sal/Package_inc.mk | |||
@@ -80,7 +80,6 @@ $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/logfile.hxx,rtl/logfile.hxx)) | |||
80 | $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/malformeduriexception.hxx,rtl/malformeduriexception.hxx)) | 80 | $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/malformeduriexception.hxx,rtl/malformeduriexception.hxx)) |
81 | $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/math.h,rtl/math.h)) | 81 | $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/math.h,rtl/math.h)) |
82 | $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/math.hxx,rtl/math.hxx)) | 82 | $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/math.hxx,rtl/math.hxx)) |
83 | $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/memory.h,rtl/memory.h)) | ||
84 | $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/process.h,rtl/process.h)) | 83 | $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/process.h,rtl/process.h)) |
85 | $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/random.h,rtl/random.h)) | 84 | $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/random.h,rtl/random.h)) |
86 | $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/ref.hxx,rtl/ref.hxx)) | 85 | $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/ref.hxx,rtl/ref.hxx)) |
diff --git a/sal/inc/rtl/memory.h b/sal/inc/rtl/memory.h deleted file mode 100644 index 25e2a73e6f6c..000000000000 --- a/sal/inc/rtl/memory.h +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | ||
2 | /* | ||
3 | * This file is part of the LibreOffice project. | ||
4 | * | ||
5 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
6 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
7 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
8 | * | ||
9 | * This file incorporates work covered by the following license notice: | ||
10 | * | ||
11 | * Licensed to the Apache Software Foundation (ASF) under one or more | ||
12 | * contributor license agreements. See the NOTICE file distributed | ||
13 | * with this work for additional information regarding copyright | ||
14 | * ownership. The ASF licenses this file to you under the Apache | ||
15 | * License, Version 2.0 (the "License"); you may not use this file | ||
16 | * except in compliance with the License. You may obtain a copy of | ||
17 | * the License at http://www.apache.org/licenses/LICENSE-2.0 . | ||
18 | */ | ||
19 | |||
20 | |||
21 | #ifndef _RTL_MEMORY_H_ | ||
22 | #define _RTL_MEMORY_H_ | ||
23 | |||
24 | #include "sal/config.h" | ||
25 | |||
26 | #include "sal/saldllapi.h" | ||
27 | #include "sal/types.h" | ||
28 | |||
29 | #ifdef __cplusplus | ||
30 | extern "C" { | ||
31 | #endif | ||
32 | |||
33 | SAL_DEPRECATED("Use memset instead") | ||
34 | SAL_DLLPUBLIC void SAL_CALL rtl_zeroMemory(void *Ptr, sal_Size Bytes); | ||
35 | SAL_DEPRECATED("Use memset instead") | ||
36 | SAL_DLLPUBLIC void SAL_CALL rtl_fillMemory(void *Ptr, sal_Size Bytes, sal_uInt8 Fill); | ||
37 | SAL_DEPRECATED("Use memcpy instead") | ||
38 | SAL_DLLPUBLIC void SAL_CALL rtl_copyMemory(void *Dst, const void *Src, sal_Size Bytes); | ||
39 | SAL_DEPRECATED("Use memmove instead") | ||
40 | SAL_DLLPUBLIC void SAL_CALL rtl_moveMemory(void *Dst, const void *Src, sal_Size Bytes); | ||
41 | SAL_DEPRECATED("Use memcmp instead") | ||
42 | SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_compareMemory(const void *MemA, const void *MemB, sal_Size Bytes); | ||
43 | SAL_DEPRECATED("Use memchr instead") | ||
44 | SAL_DLLPUBLIC void* SAL_CALL rtl_findInMemory(const void *MemA, sal_uInt8 ch, sal_Size Bytes); | ||
45 | |||
46 | #ifdef __cplusplus | ||
47 | } | ||
48 | #endif | ||
49 | |||
50 | |||
51 | #endif /*_RTL_MEMORY_H_ */ | ||
52 | |||
53 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ | ||
diff --git a/sal/osl/all/compat.cxx b/sal/osl/all/compat.cxx index fb8a1ec6e2d2..f9c712982bcf 100644 --- a/sal/osl/all/compat.cxx +++ b/sal/osl/all/compat.cxx | |||
@@ -37,6 +37,38 @@ SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL osl_tryToAcquireSemaphore(void *) { | |||
37 | for (;;) { std::abort(); } // avoid "must return a value" warnings | 37 | for (;;) { std::abort(); } // avoid "must return a value" warnings |
38 | } | 38 | } |
39 | 39 | ||
40 | SAL_DLLPUBLIC_EXPORT sal_Int32 SAL_CALL rtl_compareMemory( | ||
41 | void const *, void const *, sal_Size) | ||
42 | { | ||
43 | for (;;) { std::abort(); } // avoid "must return a value" warnings | ||
44 | } | ||
45 | |||
46 | SAL_DLLPUBLIC_EXPORT void SAL_CALL rtl_copyMemory( | ||
47 | void *, void const *, sal_Size) | ||
48 | { | ||
49 | std::abort(); | ||
50 | } | ||
51 | |||
52 | SAL_DLLPUBLIC_EXPORT void SAL_CALL rtl_fillMemory(void *, sal_Size, sal_uInt8) { | ||
53 | std::abort(); | ||
54 | } | ||
55 | |||
56 | SAL_DLLPUBLIC_EXPORT void * SAL_CALL rtl_findInMemory( | ||
57 | void const *, sal_uInt8, sal_Size) | ||
58 | { | ||
59 | for (;;) { std::abort(); } // avoid "must return a value" warnings | ||
60 | } | ||
61 | |||
62 | SAL_DLLPUBLIC_EXPORT void SAL_CALL rtl_moveMemory( | ||
63 | void *, void const *, sal_Size) | ||
64 | { | ||
65 | std::abort(); | ||
66 | } | ||
67 | |||
68 | SAL_DLLPUBLIC_EXPORT void SAL_CALL rtl_zeroMemory(void *, sal_Size) { | ||
69 | std::abort(); | ||
70 | } | ||
71 | |||
40 | } | 72 | } |
41 | 73 | ||
42 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ | 74 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |
diff --git a/sal/rtl/source/memory.cxx b/sal/rtl/source/memory.cxx deleted file mode 100644 index 2db0c03366da..000000000000 --- a/sal/rtl/source/memory.cxx +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | ||
2 | /* | ||
3 | * This file is part of the LibreOffice project. | ||
4 | * | ||
5 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
6 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
7 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
8 | * | ||
9 | * This file incorporates work covered by the following license notice: | ||
10 | * | ||
11 | * Licensed to the Apache Software Foundation (ASF) under one or more | ||
12 | * contributor license agreements. See the NOTICE file distributed | ||
13 | * with this work for additional information regarding copyright | ||
14 | * ownership. The ASF licenses this file to you under the Apache | ||
15 | * License, Version 2.0 (the "License"); you may not use this file | ||
16 | * except in compliance with the License. You may obtain a copy of | ||
17 | * the License at http://www.apache.org/licenses/LICENSE-2.0 . | ||
18 | */ | ||
19 | |||
20 | |||
21 | #include <string.h> | ||
22 | #include <rtl/memory.h> | ||
23 | |||
24 | void SAL_CALL rtl_zeroMemory(void *Ptr, sal_Size Bytes) | ||
25 | { | ||
26 | memset(Ptr, 0, Bytes); | ||
27 | } | ||
28 | |||
29 | void SAL_CALL rtl_fillMemory(void *Ptr, sal_Size Bytes, sal_uInt8 Fill) | ||
30 | { | ||
31 | memset(Ptr, Fill, Bytes); | ||
32 | } | ||
33 | |||
34 | void SAL_CALL rtl_copyMemory(void *Dst, const void *Src, sal_Size Bytes) | ||
35 | { | ||
36 | memcpy(Dst, Src, Bytes); | ||
37 | } | ||
38 | |||
39 | void SAL_CALL rtl_moveMemory(void *Dst, const void *Src, sal_Size Bytes) | ||
40 | { | ||
41 | memmove(Dst, Src, Bytes); | ||
42 | } | ||
43 | |||
44 | sal_Int32 SAL_CALL rtl_compareMemory(const void *MemA, const void *MemB, sal_Size Bytes) | ||
45 | { | ||
46 | return memcmp(MemA, MemB, Bytes); | ||
47 | } | ||
48 | |||
49 | void* SAL_CALL rtl_findInMemory(const void *MemA, sal_uInt8 ch, sal_Size Bytes) | ||
50 | { | ||
51 | return const_cast< void * >(memchr(MemA, ch, Bytes)); | ||
52 | } | ||
53 | |||
54 | |||
55 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ | ||