Move 'is_regular_file' from common-utils.c to filestuff.c
[deliverable/binutils-gdb.git] / gdb / common / common-utils.c
index 71393027f7de3214af23515fcf2c9695501a79fb..24b3936f3dcf0e49bdae1aa9cb7a05e620f70869 100644 (file)
@@ -1,6 +1,6 @@
 /* Shared general utility routines for GDB, the GNU debugger.
 
-   Copyright (C) 1986-2017 Free Software Foundation, Inc.
+   Copyright (C) 1986-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -94,13 +94,6 @@ xzalloc (size_t size)
   return xcalloc (1, size);
 }
 
-void
-xfree (void *ptr)
-{
-  if (ptr != NULL)
-    free (ptr);                /* ARI: free */
-}
-
 void
 xmalloc_failed (size_t size)
 {
@@ -415,3 +408,23 @@ stringify_argv (const std::vector<char *> &args)
 
   return ret;
 }
+
+/* See common/common-utils.h.  */
+
+ULONGEST
+align_up (ULONGEST v, int n)
+{
+  /* Check that N is really a power of two.  */
+  gdb_assert (n && (n & (n-1)) == 0);
+  return (v + n - 1) & -n;
+}
+
+/* See common/common-utils.h.  */
+
+ULONGEST
+align_down (ULONGEST v, int n)
+{
+  /* Check that N is really a power of two.  */
+  gdb_assert (n && (n & (n-1)) == 0);
+  return (v & -n);
+}
This page took 0.026704 seconds and 4 git commands to generate.