summaryrefslogtreecommitdiffstats
path: root/libril
diff options
context:
space:
mode:
authorKevin Schoedel <kevin.p.schoedel@intel.com>2012-05-25 17:00:17 -0400
committerEdwin Vane <edwin.vane@intel.com>2012-08-23 14:20:36 -0400
commit96dcdbcfe5111346f1a1f4542a8533a0a6611c01 (patch)
tree6a550c8a69b196a096a0183d164228a127bd239d /libril
parent3a8afda88d9fb3e18344ee137f60dbe9236fe368 (diff)
downloadandroid_hardware_ril-96dcdbcfe5111346f1a1f4542a8533a0a6611c01.tar.gz
android_hardware_ril-96dcdbcfe5111346f1a1f4542a8533a0a6611c01.tar.bz2
android_hardware_ril-96dcdbcfe5111346f1a1f4542a8533a0a6611c01.zip
Fixed goto into scope.
Two functions contained goto statements entering the scope of automatic variables; added explicit blocks to limit these scopes. Change-Id: Ib2d46bdc235089e208ac70bdaf405ea9e5b91ab1 Reviewed-by: Ariel J Bernal <ariel.j.bernal@intel.com> Author: Kevin Schoedel <kevin.p.schoedel@intel.com>
Diffstat (limited to 'libril')
-rw-r--r--libril/ril.cpp116
1 files changed, 60 insertions, 56 deletions
diff --git a/libril/ril.cpp b/libril/ril.cpp
index e3f7e41..dbb1f3c 100644
--- a/libril/ril.cpp
+++ b/libril/ril.cpp
@@ -1017,49 +1017,51 @@ dispatchGsmBrSmsCnf(Parcel &p, RequestInfo *pRI) {
goto invalid;
}
- RIL_GSM_BroadcastSmsConfigInfo gsmBci[num];
- RIL_GSM_BroadcastSmsConfigInfo *gsmBciPtrs[num];
+ {
+ RIL_GSM_BroadcastSmsConfigInfo gsmBci[num];
+ RIL_GSM_BroadcastSmsConfigInfo *gsmBciPtrs[num];
- startRequest;
- for (int i = 0 ; i < num ; i++ ) {
- gsmBciPtrs[i] = &gsmBci[i];
+ startRequest;
+ for (int i = 0 ; i < num ; i++ ) {
+ gsmBciPtrs[i] = &gsmBci[i];
- status = p.readInt32(&t);
- gsmBci[i].fromServiceId = (int) t;
+ status = p.readInt32(&t);
+ gsmBci[i].fromServiceId = (int) t;
- status = p.readInt32(&t);
- gsmBci[i].toServiceId = (int) t;
+ status = p.readInt32(&t);
+ gsmBci[i].toServiceId = (int) t;
- status = p.readInt32(&t);
- gsmBci[i].fromCodeScheme = (int) t;
+ status = p.readInt32(&t);
+ gsmBci[i].fromCodeScheme = (int) t;
- status = p.readInt32(&t);
- gsmBci[i].toCodeScheme = (int) t;
+ status = p.readInt32(&t);
+ gsmBci[i].toCodeScheme = (int) t;
- status = p.readInt32(&t);
- gsmBci[i].selected = (uint8_t) t;
+ status = p.readInt32(&t);
+ gsmBci[i].selected = (uint8_t) t;
- appendPrintBuf("%s [%d: fromServiceId=%d, toServiceId =%d, \
- fromCodeScheme=%d, toCodeScheme=%d, selected =%d]", printBuf, i,
- gsmBci[i].fromServiceId, gsmBci[i].toServiceId,
- gsmBci[i].fromCodeScheme, gsmBci[i].toCodeScheme,
- gsmBci[i].selected);
- }
- closeRequest;
+ appendPrintBuf("%s [%d: fromServiceId=%d, toServiceId =%d, \
+ fromCodeScheme=%d, toCodeScheme=%d, selected =%d]", printBuf, i,
+ gsmBci[i].fromServiceId, gsmBci[i].toServiceId,
+ gsmBci[i].fromCodeScheme, gsmBci[i].toCodeScheme,
+ gsmBci[i].selected);
+ }
+ closeRequest;
- if (status != NO_ERROR) {
- goto invalid;
- }
+ if (status != NO_ERROR) {
+ goto invalid;
+ }
- s_callbacks.onRequest(pRI->pCI->requestNumber,
- gsmBciPtrs,
- num * sizeof(RIL_GSM_BroadcastSmsConfigInfo *),
- pRI);
+ s_callbacks.onRequest(pRI->pCI->requestNumber,
+ gsmBciPtrs,
+ num * sizeof(RIL_GSM_BroadcastSmsConfigInfo *),
+ pRI);
#ifdef MEMSET_FREED
- memset(gsmBci, 0, num * sizeof(RIL_GSM_BroadcastSmsConfigInfo));
- memset(gsmBciPtrs, 0, num * sizeof(RIL_GSM_BroadcastSmsConfigInfo *));
+ memset(gsmBci, 0, num * sizeof(RIL_GSM_BroadcastSmsConfigInfo));
+ memset(gsmBciPtrs, 0, num * sizeof(RIL_GSM_BroadcastSmsConfigInfo *));
#endif
+ }
return;
@@ -1079,41 +1081,43 @@ dispatchCdmaBrSmsCnf(Parcel &p, RequestInfo *pRI) {
goto invalid;
}
- RIL_CDMA_BroadcastSmsConfigInfo cdmaBci[num];
- RIL_CDMA_BroadcastSmsConfigInfo *cdmaBciPtrs[num];
+ {
+ RIL_CDMA_BroadcastSmsConfigInfo cdmaBci[num];
+ RIL_CDMA_BroadcastSmsConfigInfo *cdmaBciPtrs[num];
- startRequest;
- for (int i = 0 ; i < num ; i++ ) {
- cdmaBciPtrs[i] = &cdmaBci[i];
+ startRequest;
+ for (int i = 0 ; i < num ; i++ ) {
+ cdmaBciPtrs[i] = &cdmaBci[i];
- status = p.readInt32(&t);
- cdmaBci[i].service_category = (int) t;
+ status = p.readInt32(&t);
+ cdmaBci[i].service_category = (int) t;
- status = p.readInt32(&t);
- cdmaBci[i].language = (int) t;
+ status = p.readInt32(&t);
+ cdmaBci[i].language = (int) t;
- status = p.readInt32(&t);
- cdmaBci[i].selected = (uint8_t) t;
+ status = p.readInt32(&t);
+ cdmaBci[i].selected = (uint8_t) t;
- appendPrintBuf("%s [%d: service_category=%d, language =%d, \
- entries.bSelected =%d]", printBuf, i, cdmaBci[i].service_category,
- cdmaBci[i].language, cdmaBci[i].selected);
- }
- closeRequest;
+ appendPrintBuf("%s [%d: service_category=%d, language =%d, \
+ entries.bSelected =%d]", printBuf, i, cdmaBci[i].service_category,
+ cdmaBci[i].language, cdmaBci[i].selected);
+ }
+ closeRequest;
- if (status != NO_ERROR) {
- goto invalid;
- }
+ if (status != NO_ERROR) {
+ goto invalid;
+ }
- s_callbacks.onRequest(pRI->pCI->requestNumber,
- cdmaBciPtrs,
- num * sizeof(RIL_CDMA_BroadcastSmsConfigInfo *),
- pRI);
+ s_callbacks.onRequest(pRI->pCI->requestNumber,
+ cdmaBciPtrs,
+ num * sizeof(RIL_CDMA_BroadcastSmsConfigInfo *),
+ pRI);
#ifdef MEMSET_FREED
- memset(cdmaBci, 0, num * sizeof(RIL_CDMA_BroadcastSmsConfigInfo));
- memset(cdmaBciPtrs, 0, num * sizeof(RIL_CDMA_BroadcastSmsConfigInfo *));
+ memset(cdmaBci, 0, num * sizeof(RIL_CDMA_BroadcastSmsConfigInfo));
+ memset(cdmaBciPtrs, 0, num * sizeof(RIL_CDMA_BroadcastSmsConfigInfo *));
#endif
+ }
return;