Fix compiler warnings for casting issues (only some compilers).

Fixes compiler warnings from GCC 4.2 and perhaps other compilers.
Jung-uk Kim <jkim@FreeBSD.org>
This commit is contained in:
Robert Moore 2013-06-19 09:56:23 -07:00
parent 35357adc05
commit bce1e0e71e
5 changed files with 15 additions and 6 deletions

View File

@ -177,13 +177,15 @@ AcpiDbConvertToNode (
char *InString)
{
ACPI_NAMESPACE_NODE *Node;
ACPI_SIZE Address;
if ((*InString >= 0x30) && (*InString <= 0x39))
{
/* Numeric argument, convert */
Node = ACPI_TO_POINTER (ACPI_STRTOUL (InString, NULL, 16));
Address = ACPI_STRTOUL (InString, NULL, 16);
Node = ACPI_TO_POINTER (Address);
if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
{
AcpiOsPrintf ("Address %p is invalid in this address space\n",

View File

@ -211,9 +211,11 @@ AcpiDbGetPointer (
void *Target)
{
void *ObjPtr;
ACPI_SIZE Address;
ObjPtr = ACPI_TO_POINTER (ACPI_STRTOUL (Target, NULL, 16));
Address = ACPI_STRTOUL (Target, NULL, 16);
ObjPtr = ACPI_TO_POINTER (Address);
return (ObjPtr);
}

View File

@ -855,11 +855,13 @@ AcpiDbFindReferences (
char *ObjectArg)
{
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_SIZE Address;
/* Convert string to object pointer */
ObjDesc = ACPI_TO_POINTER (ACPI_STRTOUL (ObjectArg, NULL, 16));
Address = ACPI_STRTOUL (ObjectArg, NULL, 16);
ObjDesc = ACPI_TO_POINTER (Address);
/* Search all nodes in namespace */

View File

@ -429,6 +429,7 @@ AcpiExDumpObject (
{
UINT8 *Target;
char *Name;
const char *ReferenceName;
UINT8 Count;
@ -513,8 +514,8 @@ AcpiExDumpObject (
case ACPI_EXD_REFERENCE:
AcpiExOutString ("Class Name",
ACPI_CAST_PTR (char, AcpiUtGetReferenceName (ObjDesc)));
ReferenceName = AcpiUtGetReferenceName (ObjDesc);
AcpiExOutString ("Class Name", ACPI_CAST_PTR (char, ReferenceName));
AcpiExDumpReferenceObj (ObjDesc);
break;

View File

@ -249,6 +249,7 @@ AcpiGetName (
{
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
char *NodeName;
/* Parameter validation */
@ -299,7 +300,8 @@ AcpiGetName (
/* Just copy the ACPI name from the Node and zero terminate it */
ACPI_MOVE_NAME (Buffer->Pointer, AcpiUtGetNodeName (Node));
NodeName = AcpiUtGetNodeName (Node);
ACPI_MOVE_NAME (Buffer->Pointer, NodeName);
((char *) Buffer->Pointer) [ACPI_NAME_SIZE] = 0;
Status = AE_OK;