Initialize the values in readBool, readChar and readByte functions.
Silences the following warnings:
frameworks/native/libs/binder/Parcel.cpp:1856:18: warning: The left
operand of '!=' is a garbage value.
frameworks/native/libs/binder/Parcel.cpp:1869:11: warning: Assigned
value is garbage or undefined.
frameworks/native/libs/binder/Parcel.cpp:1882:11: warning: Assigned
value is garbage or undefined.
Bug: b/
27101951
Test:Warnings are gone.
Change-Id: Iba8d242d4d9b1b48f7cafb901023133e21d9d732
status_t Parcel::readBool(bool *pArg) const
{
- int32_t tmp;
+ int32_t tmp = 0;
status_t ret = readInt32(&tmp);
*pArg = (tmp != 0);
return ret;
status_t Parcel::readChar(char16_t *pArg) const
{
- int32_t tmp;
+ int32_t tmp = 0;
status_t ret = readInt32(&tmp);
*pArg = char16_t(tmp);
return ret;
status_t Parcel::readByte(int8_t *pArg) const
{
- int32_t tmp;
+ int32_t tmp = 0;
status_t ret = readInt32(&tmp);
*pArg = int8_t(tmp);
return ret;