Skip to content

Commit

Permalink
All: const keyword changes across the ACPICA source
Browse files Browse the repository at this point in the history
Integrated most changes proposed by NetBSD.
From joerg@NetBSD.org (Joerg Sonnenberger)
ACPICA BZ 732.
  • Loading branch information
acpibob committed Mar 10, 2016
1 parent b8ea82d commit a240cbb
Show file tree
Hide file tree
Showing 30 changed files with 115 additions and 123 deletions.
11 changes: 6 additions & 5 deletions source/components/debugger/dbinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ AcpiDbSingleThread (

static void
AcpiDbDisplayCommandInfo (
char *Command,
const char *Command,
BOOLEAN DisplayAll);

static void
Expand All @@ -150,7 +150,7 @@ AcpiDbDisplayHelp (

static BOOLEAN
AcpiDbMatchCommandHelp (
char *Command,
const char *Command,
const ACPI_DB_COMMAND_HELP *Help);


Expand Down Expand Up @@ -430,7 +430,7 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] =

static BOOLEAN
AcpiDbMatchCommandHelp (
char *Command,
const char *Command,
const ACPI_DB_COMMAND_HELP *Help)
{
char *Invocation = Help->Invocation;
Expand Down Expand Up @@ -492,7 +492,7 @@ AcpiDbMatchCommandHelp (

static void
AcpiDbDisplayCommandInfo (
char *Command,
const char *Command,
BOOLEAN DisplayAll)
{
const ACPI_DB_COMMAND_HELP *Next;
Expand Down Expand Up @@ -792,7 +792,8 @@ AcpiDbMatchCommand (

for (i = CMD_FIRST_VALID; AcpiGbl_DbCommands[i].Name; i++)
{
if (strstr (AcpiGbl_DbCommands[i].Name, UserCommand) ==
if (strstr (
ACPI_CAST_PTR (char, AcpiGbl_DbCommands[i].Name), UserCommand) ==
AcpiGbl_DbCommands[i].Name)
{
return (i);
Expand Down
8 changes: 4 additions & 4 deletions source/components/debugger/dbutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ AcpiDbDumpBuffer (
UINT32 Address);
#endif

static char *Gbl_HexToAscii = "0123456789ABCDEF";


/*******************************************************************************
*
Expand Down Expand Up @@ -166,7 +164,9 @@ AcpiDbMatchArgument (

for (i = 0; Arguments[i].Name; i++)
{
if (strstr (Arguments[i].Name, UserArgument) == Arguments[i].Name)
if (strstr (
ACPI_CAST_PTR (char, Arguments[i].Name),
ACPI_CAST_PTR (char, UserArgument)) == Arguments[i].Name)
{
return (i);
}
Expand Down Expand Up @@ -458,7 +458,7 @@ AcpiDbUint32ToHexString (

for (i = 7; i >= 0; i--)
{
Buffer[i] = Gbl_HexToAscii [Value & 0x0F];
Buffer[i] = AcpiGbl_UpperHexDigits [Value & 0x0F];
Value = Value >> 4;
}
}
Expand Down
4 changes: 2 additions & 2 deletions source/components/disassembler/dmopcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,8 @@ AcpiDmMatchKeyword (
}
else
{
AcpiOsPrintf ("%s", ACPI_CAST_PTR (char,
AcpiGbl_MatchOps[(ACPI_SIZE) Op->Common.Value.Integer]));
AcpiOsPrintf ("%s",
AcpiGbl_MatchOps[(ACPI_SIZE) Op->Common.Value.Integer]);
}
}

Expand Down
8 changes: 4 additions & 4 deletions source/components/disassembler/dmresrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,31 +217,31 @@ AcpiDmDescriptorName (
void
AcpiDmDumpInteger8 (
UINT8 Value,
char *Name)
const char *Name)
{
AcpiOsPrintf ("0x%2.2X, // %s\n", Value, Name);
}

void
AcpiDmDumpInteger16 (
UINT16 Value,
char *Name)
const char *Name)
{
AcpiOsPrintf ("0x%4.4X, // %s\n", Value, Name);
}

void
AcpiDmDumpInteger32 (
UINT32 Value,
char *Name)
const char *Name)
{
AcpiOsPrintf ("0x%8.8X, // %s\n", Value, Name);
}

void
AcpiDmDumpInteger64 (
UINT64 Value,
char *Name)
const char *Name)
{
AcpiOsPrintf ("0x%8.8X%8.8X, // %s\n", ACPI_FORMAT_UINT64 (Value), Name);
}
Expand Down
6 changes: 3 additions & 3 deletions source/components/disassembler/dmresrcl.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@

/* Common names for address and memory descriptors */

static char *AcpiDmAddressNames[] =
static const char *AcpiDmAddressNames[] =
{
"Granularity",
"Range Minimum",
Expand All @@ -133,7 +133,7 @@ static char *AcpiDmAddressNames[] =
"Length"
};

static char *AcpiDmMemoryNames[] =
static const char *AcpiDmMemoryNames[] =
{
"Range Minimum",
"Range Maximum",
Expand Down Expand Up @@ -1100,7 +1100,7 @@ AcpiDmInterruptDescriptor (

void
AcpiDmVendorCommon (
char *Name,
const char *Name,
UINT8 *ByteData,
UINT32 Length,
UINT32 Level)
Expand Down
2 changes: 1 addition & 1 deletion source/components/events/evregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ void
AcpiEvAssociateRegMethod (
ACPI_OPERAND_OBJECT *RegionObj)
{
ACPI_NAME *RegNamePtr = (ACPI_NAME *) METHOD_NAME__REG;
const ACPI_NAME *RegNamePtr = ACPI_CAST_PTR (ACPI_NAME, METHOD_NAME__REG);
ACPI_NAMESPACE_NODE *MethodNode;
ACPI_NAMESPACE_NODE *Node;
ACPI_OPERAND_OBJECT *RegionObj2;
Expand Down
23 changes: 10 additions & 13 deletions source/components/executer/exdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@

static void
AcpiExOutString (
char *Title,
char *Value);
const char *Title,
const char *Value);

static void
AcpiExOutPointer (
char *Title,
void *Value);
const char *Title,
const void *Value);

static void
AcpiExDumpObject (
Expand Down Expand Up @@ -452,8 +452,7 @@ AcpiExDumpObject (
ACPI_EXDUMP_INFO *Info)
{
UINT8 *Target;
char *Name;
const char *ReferenceName;
const char *Name;
UINT8 Count;
ACPI_OPERAND_OBJECT *Start;
ACPI_OPERAND_OBJECT *Data = NULL;
Expand Down Expand Up @@ -544,9 +543,7 @@ AcpiExDumpObject (

case ACPI_EXD_REFERENCE:

ReferenceName = AcpiUtGetReferenceName (ObjDesc);
AcpiExOutString (
"Class Name", ACPI_CAST_PTR (char, ReferenceName));
AcpiExOutString ("Class Name", AcpiUtGetReferenceName (ObjDesc));
AcpiExDumpReferenceObj (ObjDesc);
break;

Expand Down Expand Up @@ -1043,16 +1040,16 @@ AcpiExDumpOperands (

static void
AcpiExOutString (
char *Title,
char *Value)
const char *Title,
const char *Value)
{
AcpiOsPrintf ("%20s : %s\n", Title, Value);
}

static void
AcpiExOutPointer (
char *Title,
void *Value)
const char *Title,
const void *Value)
{
AcpiOsPrintf ("%20s : %p\n", Title, Value);
}
Expand Down
3 changes: 1 addition & 2 deletions source/components/hardware/hwxface.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,7 @@ AcpiGetSleepTypeData (
* Evaluate the \_Sx namespace object containing the register values
* for this state
*/
Info->RelativePathname = ACPI_CAST_PTR (char,
AcpiGbl_SleepStateNames[SleepState]);
Info->RelativePathname = AcpiGbl_SleepStateNames[SleepState];

Status = AcpiNsEvaluate (Info);
if (ACPI_FAILURE (Status))
Expand Down
2 changes: 1 addition & 1 deletion source/components/namespace/nsaccess.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ AcpiNsRootInitialize (
continue;
}

Status = AcpiNsLookup (NULL, InitVal->Name, InitVal->Type,
Status = AcpiNsLookup (NULL, (char *) InitVal->Name, InitVal->Type,
ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH,
NULL, &NewNode);
if (ACPI_FAILURE (Status))
Expand Down
9 changes: 6 additions & 3 deletions source/components/namespace/nsdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ AcpiNsGetMaxDepth (
void
AcpiNsPrintPathname (
UINT32 NumSegments,
char *Pathname)
const char *Pathname)
{
UINT32 i;

Expand Down Expand Up @@ -212,6 +212,9 @@ AcpiNsPrintPathname (
}


#ifdef ACPI_OBSOLETE_FUNCTIONS
/* Not used at this time, perhaps later */

/*******************************************************************************
*
* FUNCTION: AcpiNsDumpPathname
Expand All @@ -231,7 +234,7 @@ AcpiNsPrintPathname (
void
AcpiNsDumpPathname (
ACPI_HANDLE Handle,
char *Msg,
const char *Msg,
UINT32 Level,
UINT32 Component)
{
Expand All @@ -252,7 +255,7 @@ AcpiNsDumpPathname (
AcpiOsPrintf ("\n");
return_VOID;
}

#endif

/*******************************************************************************
*
Expand Down
2 changes: 1 addition & 1 deletion source/components/parser/psopinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ AcpiPsGetOpcodeInfo (
*
******************************************************************************/

char *
const char *
AcpiPsGetOpcodeName (
UINT16 Opcode)
{
Expand Down
Loading

0 comments on commit a240cbb

Please sign in to comment.