Index: uspace/lib/c/arch/abs32le/include/limits.h
===================================================================
--- uspace/lib/c/arch/abs32le/include/limits.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcabs32le
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_abs32le__LIMITS_H_
-#define LIBC_abs32le__LIMITS_H_
-
-#define LONG_MIN MIN_INT32
-#define LONG_MAX MAX_INT32
-#define ULONG_MIN MIN_UINT32
-#define ULONG_MAX MAX_UINT32
-
-#define SIZE_MIN MIN_UINT32
-#define SIZE_MAX MAX_UINT32
-#define SSIZE_MIN MIN_INT32
-#define SSIZE_MAX MAX_INT32
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/abs32le/include/types.h
===================================================================
--- uspace/lib/c/arch/abs32le/include/types.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/lib/c/arch/abs32le/include/types.h	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -40,4 +40,10 @@
 #include <libarch/common.h>
 
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+#define SSIZE_MIN  INT32_MIN
+#define SSIZE_MAX  INT32_MAX
+
 typedef uint32_t sysarg_t;
 
Index: uspace/lib/c/arch/amd64/include/limits.h
===================================================================
--- uspace/lib/c/arch/amd64/include/limits.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcamd64
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_amd64_LIMITS_H_
-#define LIBC_amd64_LIMITS_H_
-
-#define LONG_MIN MIN_INT64
-#define LONG_MAX MAX_INT64
-#define ULONG_MIN MIN_UINT64
-#define ULONG_MAX MAX_UINT64
-
-#define SIZE_MIN MIN_UINT64
-#define SIZE_MAX MAX_UINT64
-#define SSIZE_MIN MIN_INT64
-#define SSIZE_MAX MAX_INT64
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/amd64/include/types.h
===================================================================
--- uspace/lib/c/arch/amd64/include/types.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/lib/c/arch/amd64/include/types.h	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -40,4 +40,10 @@
 #include <libarch/common.h>
 
+#define SIZE_MIN  UINT64_MIN
+#define SIZE_MAX  UINT64_MAX
+
+#define SSIZE_MIN  INT64_MIN
+#define SSIZE_MAX  INT64_MAX
+
 typedef uint64_t sysarg_t;
 
Index: uspace/lib/c/arch/arm32/include/limits.h
===================================================================
--- uspace/lib/c/arch/arm32/include/limits.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/*
- * Copyright (c) 2007 Michal Kebrt
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcarm32
- * @{
- */
-/** @file
- *  @brief Limits declarations.
- */
-
-#ifndef LIBC_arm32__LIMITS_H_
-#define LIBC_arm32__LIMITS_H_
-
-#define LONG_MIN MIN_INT32
-#define LONG_MAX MAX_INT32
-#define ULONG_MIN MIN_UINT32
-#define ULONG_MAX MAX_UINT32
-
-#define SIZE_MIN MIN_UINT32
-#define SIZE_MAX MAX_UINT32
-#define SSIZE_MIN MIN_INT32
-#define SSIZE_MAX MAX_INT32
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/arm32/include/types.h
===================================================================
--- uspace/lib/c/arch/arm32/include/types.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/lib/c/arch/arm32/include/types.h	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -41,4 +41,10 @@
 #include <libarch/common.h>
 
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+#define SSIZE_MIN  INT32_MIN
+#define SSIZE_MAX  INT32_MAX
+
 typedef uint32_t sysarg_t;
 
Index: uspace/lib/c/arch/ia32/include/limits.h
===================================================================
--- uspace/lib/c/arch/ia32/include/limits.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcia32
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_ia32__LIMITS_H_
-#define LIBC_ia32__LIMITS_H_
-
-#define LONG_MIN MIN_INT32
-#define LONG_MAX MAX_INT32
-#define ULONG_MIN MIN_UINT32
-#define ULONG_MAX MAX_UINT32
-
-#define SIZE_MIN MIN_UINT32
-#define SIZE_MAX MAX_UINT32
-#define SSIZE_MIN MIN_INT32
-#define SSIZE_MAX MAX_INT32
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/ia32/include/types.h
===================================================================
--- uspace/lib/c/arch/ia32/include/types.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/lib/c/arch/ia32/include/types.h	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -40,4 +40,10 @@
 #include <libarch/common.h>
 
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+#define SSIZE_MIN  INT32_MIN
+#define SSIZE_MAX  INT32_MAX
+
 typedef uint32_t sysarg_t;
 
Index: uspace/lib/c/arch/ia64/include/limits.h
===================================================================
--- uspace/lib/c/arch/ia64/include/limits.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcia64
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_ia64_LIMITS_H_
-#define LIBC_ia64_LIMITS_H_
-
-#define LONG_MIN MIN_INT64
-#define LONG_MAX MAX_INT64
-#define ULONG_MIN MIN_UINT64
-#define ULONG_MAX MAX_UINT64
-
-#define SIZE_MIN MIN_UINT64
-#define SIZE_MAX MAX_UINT64
-#define SSIZE_MIN MIN_INT64
-#define SSIZE_MAX MAX_INT64
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/ia64/include/types.h
===================================================================
--- uspace/lib/c/arch/ia64/include/types.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/lib/c/arch/ia64/include/types.h	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -40,4 +40,10 @@
 #include <libarch/common.h>
 
+#define SIZE_MIN  UINT64_MIN
+#define SIZE_MAX  UINT64_MAX
+
+#define SSIZE_MIN  INT64_MIN
+#define SSIZE_MAX  INT64_MAX
+
 typedef struct {
 	uint64_t lo;
Index: uspace/lib/c/arch/mips32/include/limits.h
===================================================================
--- uspace/lib/c/arch/mips32/include/limits.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcmips32
- * @{
- */
-/** @file
- * @ingroup libcmips32eb
- */
-
-#ifndef LIBC_mips32__LIMITS_H_
-#define LIBC_mips32__LIMITS_H_
-
-#define LONG_MIN MIN_INT32
-#define LONG_MAX MAX_INT32
-#define ULONG_MIN MIN_UINT32
-#define ULONG_MAX MAX_UINT32
-
-#define SIZE_MIN MIN_UINT32
-#define SIZE_MAX MAX_UINT32
-#define SSIZE_MIN MIN_INT32
-#define SSIZE_MAX MAX_INT32
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/mips32/include/types.h
===================================================================
--- uspace/lib/c/arch/mips32/include/types.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/lib/c/arch/mips32/include/types.h	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -41,4 +41,10 @@
 #include <libarch/common.h>
 
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+#define SSIZE_MIN  INT32_MIN
+#define SSIZE_MAX  INT32_MAX
+
 typedef uint32_t sysarg_t;
 
Index: uspace/lib/c/arch/mips32eb/include/limits.h
===================================================================
--- uspace/lib/c/arch/mips32eb/include/limits.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ 	(revision )
@@ -1,1 +1,0 @@
-../../mips32/include/limits.h
Index: uspace/lib/c/arch/ppc32/include/limits.h
===================================================================
--- uspace/lib/c/arch/ppc32/include/limits.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcppc32
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_ppc32_LIMITS_H_
-#define LIBC_ppc32_LIMITS_H_
-
-#define LONG_MIN MIN_INT32
-#define LONG_MAX MAX_INT32
-#define ULONG_MIN MIN_UINT32
-#define ULONG_MAX MAX_UINT32
-
-#define SIZE_MIN MIN_UINT32
-#define SIZE_MAX MAX_UINT32
-#define SSIZE_MIN MIN_INT32
-#define SSIZE_MAX MAX_INT32
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/ppc32/include/types.h
===================================================================
--- uspace/lib/c/arch/ppc32/include/types.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/lib/c/arch/ppc32/include/types.h	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -40,4 +40,10 @@
 #include <libarch/common.h>
 
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+#define SSIZE_MIN  INT32_MIN
+#define SSIZE_MAX  INT32_MAX
+
 typedef uint32_t sysarg_t;
 
Index: uspace/lib/c/arch/sparc64/include/limits.h
===================================================================
--- uspace/lib/c/arch/sparc64/include/limits.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcsparc64
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_sparc64_LIMITS_H_
-#define LIBC_sparc64_LIMITS_H_
-
-#define LONG_MIN MIN_INT64
-#define LONG_MAX MAX_INT64
-#define ULONG_MIN MIN_UINT64
-#define ULONG_MAX MAX_UINT64
-
-#define SIZE_MIN MIN_UINT64
-#define SIZE_MAX MAX_UINT64
-#define SSIZE_MIN MIN_INT64
-#define SSIZE_MAX MAX_INT64
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/sparc64/include/types.h
===================================================================
--- uspace/lib/c/arch/sparc64/include/types.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/lib/c/arch/sparc64/include/types.h	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -40,4 +40,10 @@
 #include <libarch/common.h>
 
+#define SIZE_MIN  UINT64_MIN
+#define SIZE_MAX  UINT64_MAX
+
+#define SSIZE_MIN  INT64_MIN
+#define SSIZE_MAX  INT64_MAX
+
 typedef uint64_t sysarg_t;
 
Index: uspace/lib/c/generic/str.c
===================================================================
--- uspace/lib/c/generic/str.c	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/lib/c/generic/str.c	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -37,5 +37,5 @@
 #include <stdlib.h>
 #include <assert.h>
-#include <limits.h>
+#include <stdint.h>
 #include <ctype.h>
 #include <malloc.h>
Index: uspace/lib/c/include/limits.h
===================================================================
--- uspace/lib/c/include/limits.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ 	(revision )
@@ -1,84 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_LIMITS_H_
-#define LIBC_LIMITS_H_
-
-#include <stdint.h>
-#include <libarch/limits.h>
-
-/* char */
-#define SCHAR_MIN MIN_INT8
-#define SCHAR_MAX MAX_INT8
-#define UCHAR_MIN MIN_UINT8
-#define UCHAR_MAX MAX_UINT8
-
-#ifdef __CHAR_UNSIGNED__
-	#define CHAR_MIN UCHAR_MIN
-	#define CHAR_MAX UCHAR_MAX
-#else
-	#define CHAR_MIN SCHAR_MIN
-	#define CHAR_MAX SCHAR_MAX
-#endif
-
-/* short int */
-#define SHRT_MIN MIN_INT16
-#define SHRT_MAX MAX_INT16
-#define USHRT_MIN MIN_UINT16
-#define USHRT_MAX MAX_UINT16
-
-/* int */
-#define INT_MIN MIN_INT32
-#define INT_MAX MAX_INT32
-#define UINT_MIN MIN_UINT32
-#define UINT_MAX MAX_UINT32
-
-/* long long int */
-#define LLONG_MIN MIN_INT64
-#define LLONG_MAX MAX_INT64
-#define ULLONG_MIN MIN_UINT64
-#define ULLONG_MAX MAX_UINT64
-
-/* off64_t */
-#define OFF64_MIN MIN_INT64
-#define OFF64_MAX MAX_INT64
-
-/* aoff64_t */
-#define AOFF64_MIN MIN_UINT64
-#define AOFF64_MAX MAX_UINT64
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/stdint.h
===================================================================
--- uspace/lib/c/include/stdint.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/lib/c/include/stdint.h	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -36,26 +36,37 @@
 #define LIBC_STDINT_H_
 
-/* Definitions of types with fixed size */
+#define INT8_MIN  (0x80)
+#define INT8_MAX  (0x7F)
+
+#define UINT8_MIN  (0u)
+#define UINT8_MAX  (0xFFu)
+
+#define INT16_MIN  (0x8000)
+#define INT16_MAX  (0x7FFF)
+
+#define UINT16_MIN  (0u)
+#define UINT16_MAX  (0xFFFFu)
+
+#define INT32_MIN  (0x80000000l)
+#define INT32_MAX  (0x7FFFFFFFl)
+
+#define UINT32_MIN  (0ul)
+#define UINT32_MAX  (0xFFFFFFFFul)
+
+#define INT64_MIN  (0x8000000000000000ll)
+#define INT64_MAX  (0x7FFFFFFFFFFFFFFFll)
+
+#define UINT64_MIN  (0ull)
+#define UINT64_MAX  (0xFFFFFFFFFFFFFFFFull)
+
 #include <libarch/types.h>
 
-#define MAX_INT8 (0x7F)
-#define MIN_INT8 (0x80)
-#define MAX_UINT8 (0xFFu)
-#define MIN_UINT8 (0u)
+/* off64_t */
+#define OFF64_MIN  INT64_MIN
+#define OFF64_MAX  INT64_MAX
 
-#define MAX_INT16 (0x7FFF)
-#define MIN_INT16 (0x8000)
-#define MAX_UINT16 (0xFFFFu)
-#define MIN_UINT16 (0u)
-
-#define MAX_INT32 (0x7FFFFFFF)
-#define MIN_INT32 (0x80000000)
-#define MAX_UINT32 (0xFFFFFFFFu)
-#define MIN_UINT32 (0u)
-
-#define MAX_INT64 (0x7FFFFFFFFFFFFFFFll)
-#define MIN_INT64 (0x8000000000000000ll)
-#define MAX_UINT64 (0xFFFFFFFFFFFFFFFFull)
-#define MIN_UINT64 (0ull)
+/* aoff64_t */
+#define AOFF64_MIN  UINT64_MIN
+#define AOFF64_MAX  UINT64_MAX
 
 #endif
Index: uspace/lib/pci/types.h
===================================================================
--- uspace/lib/pci/types.h	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/lib/pci/types.h	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -18,32 +18,45 @@
 
 #ifdef PCI_HAVE_64BIT_ADDRESS
-#include <limits.h>
+
+#include <stdint.h>
+
 #if ULONG_MAX > 0xffffffff
+
 typedef unsigned long u64;
 #define PCI_U64_FMT "l"
-#else
+
+#else /* ULONG_MAX > 0xffffffff */
+
 typedef unsigned long long u64;
 #define PCI_U64_FMT "ll"
-#endif
-#endif
 
-#endif				/* PCI_HAVE_Uxx_TYPES */
+#endif /* ULONG_MAX > 0xffffffff */
+#endif /* PCI_HAVE_64BIT_ADDRESS */
+#endif /* PCI_HAVE_Uxx_TYPES */
 
 #ifdef PCI_HAVE_64BIT_ADDRESS
+
 typedef u64 pciaddr_t;
 #define PCIADDR_T_FMT "%08" PCI_U64_FMT "x"
 #define PCIADDR_PORT_FMT "%04" PCI_U64_FMT "x"
-#else
+
+#else /* PCI_HAVE_64BIT_ADDRESS */
+
 typedef u32 pciaddr_t;
 #define PCIADDR_T_FMT "%08x"
 #define PCIADDR_PORT_FMT "%04x"
-#endif
+
+#endif /* PCI_HAVE_64BIT_ADDRESS */
 
 #ifdef PCI_ARCH_SPARC64
+
 /* On sparc64 Linux the kernel reports remapped port addresses and IRQ numbers */
 #undef PCIADDR_PORT_FMT
 #define PCIADDR_PORT_FMT PCIADDR_T_FMT
 #define PCIIRQ_FMT "%08x"
-#else
+
+#else /* PCI_ARCH_SPARC64 */
+
 #define PCIIRQ_FMT "%d"
-#endif
+
+#endif /* PCI_ARCH_SPARC64 */
Index: uspace/lib/socket/generic/socket_client.c
===================================================================
--- uspace/lib/socket/generic/socket_client.c	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/lib/socket/generic/socket_client.c	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -40,5 +40,5 @@
 #include <async.h>
 #include <fibril_synch.h>
-#include <limits.h>
+#include <stdint.h>
 #include <stdlib.h>
 
Index: uspace/lib/socket/generic/socket_core.c
===================================================================
--- uspace/lib/socket/generic/socket_core.c	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/lib/socket/generic/socket_core.c	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -35,5 +35,5 @@
  */
 
-#include <limits.h>
+#include <stdint.h>
 #include <stdlib.h>
 
Index: uspace/lib/softfloat/generic/conversion.c
===================================================================
--- uspace/lib/softfloat/generic/conversion.c	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/lib/softfloat/generic/conversion.c	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup softfloat	
+/** @addtogroup softfloat
  * @{
  */
@@ -45,7 +45,7 @@
 	result.parts.sign = a.parts.sign;
 	result.parts.fraction = a.parts.fraction;
-	result.parts.fraction <<= (FLOAT64_FRACTION_SIZE - FLOAT32_FRACTION_SIZE );
-	
-	if ((isFloat32Infinity(a))||(isFloat32NaN(a))) {
+	result.parts.fraction <<= (FLOAT64_FRACTION_SIZE - FLOAT32_FRACTION_SIZE);
+	
+	if ((isFloat32Infinity(a)) || (isFloat32NaN(a))) {
 		result.parts.exp = 0x7FF;
 		/* TODO; check if its correct for SigNaNs*/
@@ -53,5 +53,5 @@
 	};
 	
-	result.parts.exp = a.parts.exp + ( (int)FLOAT64_BIAS - FLOAT32_BIAS );
+	result.parts.exp = a.parts.exp + ((int) FLOAT64_BIAS - FLOAT32_BIAS);
 	if (a.parts.exp == 0) {
 		/* normalize denormalized numbers */
@@ -181,16 +181,15 @@
 uint32_t float32_to_uint32(float32 a)
 {
-	if (isFloat32NaN(a)) {
-		return MAX_UINT32;
-	}
-	
-	if (isFloat32Infinity(a) || (a.parts.exp >= (32 + FLOAT32_BIAS)))  {
-		if (a.parts.sign) {
-			return MIN_UINT32;
-		}
-		return MAX_UINT32;
-	}
-	
-	return _float32_to_uint32_helper(a);	
+	if (isFloat32NaN(a))
+		return UINT32_MAX;
+	
+	if (isFloat32Infinity(a) || (a.parts.exp >= (32 + FLOAT32_BIAS))) {
+		if (a.parts.sign)
+			return UINT32_MIN;
+		
+		return UINT32_MAX;
+	}
+	
+	return _float32_to_uint32_helper(a);
 }
 
@@ -201,16 +200,16 @@
 int32_t float32_to_int32(float32 a)
 {
-	if (isFloat32NaN(a)) {
-		return MAX_INT32;
-	}
-	
-	if (isFloat32Infinity(a) || (a.parts.exp >= (32 + FLOAT32_BIAS)))  {
-		if (a.parts.sign) {
-			return MIN_INT32;
-		}
-		return MAX_INT32;
-	}
+	if (isFloat32NaN(a))
+		return INT32_MAX;
+	
+	if (isFloat32Infinity(a) || (a.parts.exp >= (32 + FLOAT32_BIAS))) {
+		if (a.parts.sign)
+			return INT32_MIN;
+		
+		return INT32_MAX;
+	}
+	
 	return _float32_to_uint32_helper(a);
-}	
+}
 
 
@@ -249,16 +248,16 @@
 uint64_t float64_to_uint64(float64 a)
 {
-	if (isFloat64NaN(a)) {
-		return MAX_UINT64;
-	}
-	
-	if (isFloat64Infinity(a) || (a.parts.exp >= (64 + FLOAT64_BIAS)))  {
-		if (a.parts.sign) {
-			return MIN_UINT64;
-		}
-		return MAX_UINT64;
-	}
-	
-	return _float64_to_uint64_helper(a);	
+	if (isFloat64NaN(a))
+		return UINT64_MAX;
+	
+	
+	if (isFloat64Infinity(a) || (a.parts.exp >= (64 + FLOAT64_BIAS))) {
+		if (a.parts.sign)
+			return UINT64_MIN;
+		
+		return UINT64_MAX;
+	}
+	
+	return _float64_to_uint64_helper(a);
 }
 
@@ -269,16 +268,17 @@
 int64_t float64_to_int64(float64 a)
 {
-	if (isFloat64NaN(a)) {
-		return MAX_INT64;
-	}
-	
-	if (isFloat64Infinity(a) || (a.parts.exp >= (64 + FLOAT64_BIAS)))  {
-		if (a.parts.sign) {
-			return MIN_INT64;
-		}
-		return MAX_INT64;
-	}
+	if (isFloat64NaN(a))
+		return INT64_MAX;
+	
+	
+	if (isFloat64Infinity(a) || (a.parts.exp >= (64 + FLOAT64_BIAS))) {
+		if (a.parts.sign)
+			return INT64_MIN;
+		
+		return INT64_MAX;
+	}
+	
 	return _float64_to_uint64_helper(a);
-}	
+}
 
 
@@ -320,16 +320,16 @@
 uint64_t float32_to_uint64(float32 a)
 {
-	if (isFloat32NaN(a)) {
-		return MAX_UINT64;
-	}
-	
-	if (isFloat32Infinity(a) || (a.parts.exp >= (64 + FLOAT32_BIAS)))  {
-		if (a.parts.sign) {
-			return MIN_UINT64;
-		}
-		return MAX_UINT64;
-	}
-	
-	return _float32_to_uint64_helper(a);	
+	if (isFloat32NaN(a))
+		return UINT64_MAX;
+	
+	
+	if (isFloat32Infinity(a) || (a.parts.exp >= (64 + FLOAT32_BIAS))) {
+		if (a.parts.sign)
+			return UINT64_MIN;
+		
+		return UINT64_MAX;
+	}
+	
+	return _float32_to_uint64_helper(a);
 }
 
@@ -340,16 +340,16 @@
 int64_t float32_to_int64(float32 a)
 {
-	if (isFloat32NaN(a)) {
-		return MAX_INT64;
-	}
-	
-	if (isFloat32Infinity(a) || (a.parts.exp >= (64 + FLOAT32_BIAS)))  {
-		if (a.parts.sign) {
-			return (MIN_INT64);
-		}
-		return MAX_INT64;
-	}
+	if (isFloat32NaN(a))
+		return INT64_MAX;
+	
+	if (isFloat32Infinity(a) || (a.parts.exp >= (64 + FLOAT32_BIAS))) {
+		if (a.parts.sign)
+			return INT64_MIN;
+		
+		return INT64_MAX;
+	}
+	
 	return _float32_to_uint64_helper(a);
-}	
+}
 
 
@@ -360,16 +360,16 @@
 uint32_t float64_to_uint32(float64 a)
 {
-	if (isFloat64NaN(a)) {
-		return MAX_UINT32;
-	}
-	
-	if (isFloat64Infinity(a) || (a.parts.exp >= (32 + FLOAT64_BIAS)))  {
-		if (a.parts.sign) {
-			return MIN_UINT32;
-		}
-		return MAX_UINT32;
-	}
-	
-	return (uint32_t)_float64_to_uint64_helper(a);	
+	if (isFloat64NaN(a))
+		return UINT32_MAX;
+	
+	
+	if (isFloat64Infinity(a) || (a.parts.exp >= (32 + FLOAT64_BIAS))) {
+		if (a.parts.sign)
+			return UINT32_MIN;
+		
+		return UINT32_MAX;
+	}
+	
+	return (uint32_t) _float64_to_uint64_helper(a);
 }
 
@@ -380,16 +380,17 @@
 int32_t float64_to_int32(float64 a)
 {
-	if (isFloat64NaN(a)) {
-		return MAX_INT32;
-	}
-	
-	if (isFloat64Infinity(a) || (a.parts.exp >= (32 + FLOAT64_BIAS)))  {
-		if (a.parts.sign) {
-			return MIN_INT32;
-		}
-		return MAX_INT32;
-	}
-	return (int32_t)_float64_to_uint64_helper(a);
-}	
+	if (isFloat64NaN(a))
+		return INT32_MAX;
+	
+	
+	if (isFloat64Infinity(a) || (a.parts.exp >= (32 + FLOAT64_BIAS))) {
+		if (a.parts.sign)
+			return INT32_MIN;
+		
+		return INT32_MAX;
+	}
+	
+	return (int32_t) _float64_to_uint64_helper(a);
+}
 
 /** Convert unsigned integer to float32
Index: uspace/lib/softint/generic/multiplication.c
===================================================================
--- uspace/lib/softint/generic/multiplication.c	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/lib/softint/generic/multiplication.c	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -29,5 +29,5 @@
 /** @addtogroup softint
  * @{
- */ 
+ */
 /**
  * @file
@@ -36,34 +36,29 @@
 
 #include <multiplication.h>
-#include <stdint.h> 
+#include <stdint.h>
 
-/** Set 1 to return MAX_INT64 or MIN_INT64 on overflow */
+/** Set 1 to return INT64_MAX or INT64_MIN on overflow */
 #ifndef SOFTINT_CHECK_OF
-# define SOFTINT_CHECK_OF 0
+	#define SOFTINT_CHECK_OF  0
 #endif
 
-/**
- * Multiply two integers and return long long as result. 
+/** Multiply two integers and return long long as result.
+ *
  * This function is overflow safe.
- * @param a
- * @param b
- * @result
+ *
  */
 static unsigned long long mul(unsigned int a, unsigned int b) {
-	unsigned int a1, a2, b1, b2;
-	unsigned long long t1, t2, t3;	
-
-	a1 = a >> 16;
-	a2 = a & MAX_UINT16;
-	b1 = b >> 16;
-	b2 = b & MAX_UINT16;
-
-	t1 = a1 * b1;
-	t2 = a1*b2;
-	t2 += a2*b1;
-	t3 = a2*b2;
-
-	t3 = (((t1 << 16) + t2) << 16) + t3; 
-
+	unsigned int a1 = a >> 16;
+	unsigned int a2 = a & UINT16_MAX;
+	unsigned int b1 = b >> 16;
+	unsigned int b2 = b & UINT16_MAX;
+	
+	unsigned long long t1 = a1 * b1;
+	unsigned long long t2 = a1 * b2;
+	t2 += a2 * b1;
+	unsigned long long t3 = a2 * b2;
+	
+	t3 = (((t1 << 16) + t2) << 16) + t3;
+	
 	return t3;
 }
@@ -74,57 +69,54 @@
 long long __muldi3 (long long a, long long b)
 {
-	long long result;
-	unsigned long long t1,t2;
-	unsigned long long a1, a2, b1, b2;
 	char neg = 0;
-
+	
 	if (a < 0) {
 		neg = !neg;
 		a = -a;
 	}
-
+	
 	if (b < 0) {
 		neg = !neg;
 		b = -b;
 	}
-
-	a1 = a >> 32;
-	b1 = b >> 32;
-
-	a2 = a & (MAX_UINT32);
-	b2 = b & (MAX_UINT32);
-
+	
+	unsigned long long a1 = a >> 32;
+	unsigned long long b1 = b >> 32;
+	
+	unsigned long long a2 = a & (UINT32_MAX);
+	unsigned long long b2 = b & (UINT32_MAX);
+	
 	if (SOFTINT_CHECK_OF && (a1 != 0) && (b1 != 0)) {
-		// error, overflow
-		return (neg?MIN_INT64:MAX_INT64);
+		/* Error (overflow) */
+		return (neg ? INT64_MIN : INT64_MAX);
 	}
-
-	// (if OF checked) a1 or b1 is zero => result fits in 64 bits, no need to another overflow check
-	t1 = mul(a1,b2) + mul(b1,a2);	
-
-	if (SOFTINT_CHECK_OF && t1 > MAX_UINT32) {
-		// error, overflow
-		return (neg?MIN_INT64:MAX_INT64);
+	
+	/* (if OF checked) a1 or b1 is zero => result fits in 64 bits,
+	 * no need to another overflow check
+	 */
+	unsigned long long t1 = mul(a1, b2) + mul(b1, a2);
+	
+	if ((SOFTINT_CHECK_OF) && (t1 > UINT32_MAX)) {
+		/* Error (overflow) */
+		return (neg ? INT64_MIN : INT64_MAX);
 	}
-
+	
 	t1 = t1 << 32;
-	t2 = mul(a2,b2);
+	unsigned long long t2 = mul(a2, b2);
 	t2 += t1;
-
+	
 	/* t2 & (1ull << 63) - if this bit is set in unsigned long long,
 	 * result does not fit in signed one */
 	if (SOFTINT_CHECK_OF && ((t2 < t1) || (t2 & (1ull << 63)))) {
 		// error, overflow
-		return (neg?MIN_INT64:MAX_INT64);
+		return (neg ? INT64_MIN : INT64_MAX);
 	}
-
-	result = t2;
-
-	if (neg) {
+	
+	long long result = t2;
+	if (neg)
 		result = -result;
-	}
-
+	
 	return result;
-}	
+}
 
 /** @}
Index: uspace/srv/fs/tmpfs/tmpfs_ops.c
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -41,5 +41,5 @@
 #include <ipc/ipc.h>
 #include <macros.h>
-#include <limits.h>
+#include <stdint.h>
 #include <async.h>
 #include <errno.h>
Index: uspace/srv/net/tl/icmp/icmp.c
===================================================================
--- uspace/srv/net/tl/icmp/icmp.c	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/srv/net/tl/icmp/icmp.c	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -98,5 +98,5 @@
 /** Free identifier numbers pool end.
  */
-#define ICMP_FREE_IDS_END	MAX_UINT16
+#define ICMP_FREE_IDS_END	UINT16_MAX
 
 /** Computes the ICMP datagram checksum.
@@ -263,5 +263,5 @@
 	}else{
 		res = icmp_echo(echo_data->identifier, echo_data->sequence_number, size, timeout, ttl, tos, dont_fragment, addr, addrlen);
-		if(echo_data->sequence_number < MAX_UINT16){
+		if(echo_data->sequence_number < UINT16_MAX){
 			++ echo_data->sequence_number;
 		}else{
@@ -731,5 +731,5 @@
 							fibril_rwlock_write_unlock(&icmp_globals.lock);
 							free(addr);
-							if(echo_data->sequence_number < MAX_UINT16){
+							if(echo_data->sequence_number < UINT16_MAX){
 								++ echo_data->sequence_number;
 							}else{
Index: uspace/srv/vfs/vfs_ops.c
===================================================================
--- uspace/srv/vfs/vfs_ops.c	(revision 538780736253a52c38332ffe3f75d60f64190f4e)
+++ uspace/srv/vfs/vfs_ops.c	(revision 9539be6c880110557328e7e518cf276b94c1b07f)
@@ -39,5 +39,5 @@
 #include <ipc/ipc.h>
 #include <macros.h>
-#include <limits.h>
+#include <stdint.h>
 #include <async.h>
 #include <errno.h>
