summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2011-08-05 11:58:38 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2011-11-17 21:15:19 +0100
commitad69fc551b03e7f38e2c26b5d3ae2d5b2efb171a (patch)
tree5616ad903030379af21d89abfe58b6bde3aeb354
parent97592e06b0444f8a3ff49da6a0f892f15a4ae394 (diff)
Mark unused parameters as such to avoid compiler warnings
-rw-r--r--connectivity/source/drivers/postgresql/pq_allocator.hxx9
-rw-r--r--connectivity/source/drivers/postgresql/pq_common.hxx40
2 files changed, 46 insertions, 3 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_allocator.hxx b/connectivity/source/drivers/postgresql/pq_allocator.hxx
index 0bb8a7ab2e07..43e2d8b5489c 100644
--- a/connectivity/source/drivers/postgresql/pq_allocator.hxx
+++ b/connectivity/source/drivers/postgresql/pq_allocator.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* $RCSfile: pq_allocator.hxx,v $
@@ -68,6 +69,8 @@
#include <cstddef>
#include "sal/types.h"
+#include "pq_common.hxx"
+
/** jbu: This source has been copied from sal/inc/internal/allocator.hxx,
because it is not a public interface. Thx a lot for figuring this
out.
@@ -160,14 +163,14 @@ public:
are not enabled, e.g. GCC under Linux and it is
in general not desired to compile sal with exceptions
enabled. */
- pointer allocate (size_type n, const void* hint = 0)
+ pointer allocate (size_type n, const void* UNUSED(hint) = 0)
{
return reinterpret_cast<pointer>(
rtl_allocateMemory(sal_uInt32(n * sizeof(T))));
}
//-----------------------------------------
- void deallocate (pointer p, size_type n)
+ void deallocate (pointer p, size_type UNUSED(n))
{
rtl_freeMemory(p);
}
@@ -234,4 +237,4 @@ namespace _STL
#endif
#endif
-#endif /* INCLUDED_SAL_INTERNAL_ALLOCATOR_HXX */
+#endif /* _PQ_ALLOCATOR_ */
diff --git a/connectivity/source/drivers/postgresql/pq_common.hxx b/connectivity/source/drivers/postgresql/pq_common.hxx
new file mode 100644
index 000000000000..c712f2c9f05a
--- /dev/null
+++ b/connectivity/source/drivers/postgresql/pq_common.hxx
@@ -0,0 +1,40 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * Copyright 2011 Lionel Elie Mamane <lionel@mamane.lu>
+ *
+ * LibreOffice - a multi-platform office productivity suite
+ *
+ * This file is part of LibreOffice.
+ *
+ * LibreOffice is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * LibreOffice is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with LibreOffice. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+#ifndef _PQ_COMMON_
+#define _PQ_COMMON_
+
+#ifdef UNUSED
+#elif defined(__GNUC__)
+# define UNUSED(x) UNUSED_ ## x __attribute__((unused))
+#elif defined(__LCLINT__)
+# define UNUSED(x) /*@unused@*/ x
+#else
+# define UNUSED(x) x
+#endif
+
+#endif /* _PQ_COMMON_ */