2003-09-19 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / utils.c
index 23032b74abfd773475bd6e4674d009d220878e43..46b24b629ca44ec512c0bed1ef1c7e68c09d6874 100644 (file)
@@ -2929,3 +2929,19 @@ gnu_debuglink_crc32 (unsigned long crc, unsigned char *buf, size_t len)
     crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8);
   return ~crc & 0xffffffff;;
 }
+
+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;
+}
+
+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.02249 seconds and 4 git commands to generate.