From df3db90affc0bc9df9a1f3d03f9d4d8cf3355299 Mon Sep 17 00:00:00 2001 From: Eric Mader Date: Tue, 3 Jun 2003 18:28:00 +0000 Subject: [PATCH] ICU-2243 rename Utilities to LXUtilities to lessen the chance of name confilcts. X-SVN-Rev: 12250 --- icu4c/source/layoutex/Utilities.cpp | 99 ----------------------------- icu4c/source/layoutex/Utilities.h | 26 -------- 2 files changed, 125 deletions(-) delete mode 100644 icu4c/source/layoutex/Utilities.cpp delete mode 100644 icu4c/source/layoutex/Utilities.h diff --git a/icu4c/source/layoutex/Utilities.cpp b/icu4c/source/layoutex/Utilities.cpp deleted file mode 100644 index a7796f9402a..00000000000 --- a/icu4c/source/layoutex/Utilities.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - ********************************************************************** - * Copyright (C) 2002, International Business Machines - * Corporation and others. All Rights Reserved. - ********************************************************************** - */ - -#include "layout/LETypes.h" -#include "Utilities.h" - -U_NAMESPACE_BEGIN - -// -// Finds the high bit by binary searching -// through the bits in n. -// -le_int8 Utilities::highBit(le_int32 value) -{ - if (value <= 0) { - return -32; - } - - le_int8 bit = 0; - - if (value >= 1 << 16) { - value >>= 16; - bit += 16; - } - - if (value >= 1 << 8) { - value >>= 8; - bit += 8; - } - - if (value >= 1 << 4) { - value >>= 4; - bit += 4; - } - - if (value >= 1 << 2) { - value >>= 2; - bit += 2; - } - - if (value >= 1 << 1) { - value >>= 1; - bit += 1; - } - - return bit; -} - -le_int32 Utilities::search(le_int32 value, const le_int32 array[], le_int32 count) -{ - le_int32 power = 1 << highBit(count); - le_int32 extra = count - power; - le_int32 probe = power; - le_int32 index = 0; - - if (value >= array[extra]) { - index = extra; - } - - while (probe > (1 << 0)) { - probe >>= 1; - - if (value >= array[index + probe]) { - index += probe; - } - } - - return index; -} - -void Utilities::reverse(le_int32 array[], le_int32 length) -{ - le_int32 front, back; - - for (front = 0, back = length - 1; front < back; front += 1, back -= 1) { - le_int32 swap = array[front]; - - array[front] = array[back]; - array[back] = swap; - } -} - -void Utilities::reverse(float array[], le_int32 length) -{ - le_int32 front, back; - - for (front = 0, back = length - 1; front < back; front += 1, back -= 1) { - float swap = array[front]; - - array[front] = array[back]; - array[back] = swap; - } -} - -U_NAMESPACE_END diff --git a/icu4c/source/layoutex/Utilities.h b/icu4c/source/layoutex/Utilities.h deleted file mode 100644 index d63201a4d92..00000000000 --- a/icu4c/source/layoutex/Utilities.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - ********************************************************************** - * Copyright (C) 2002, International Business Machines - * Corporation and others. All Rights Reserved. - ********************************************************************** - */ - -#ifndef __UTILITIES_H - -#define __UTILITIES_H - -#include "layout/LETypes.h" - -U_NAMESPACE_BEGIN - -class Utilities -{ -public: - static le_int8 highBit(le_int32 value); - static le_int32 search(le_int32 value, const le_int32 array[], le_int32 count); - static void reverse(le_int32 array[], le_int32 count); - static void reverse(float array[], le_int32 count); -}; - -U_NAMESPACE_END -#endif