Skip to content

Commit 7b3757d

Browse files
authored
Clang-tidy and common typo fixes (#1209)
1 parent 03b8d7e commit 7b3757d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+444
-546
lines changed

app/src/util_ios.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ class ClassMethodImplementationCache {
313313
// indexed by selector name with each element that referencing a dictionary
314314
// of potential names for the selector that contains the original method
315315
// implementation on the class.
316-
// i.e
316+
// i.e.
317317
// selector_implementation_names_dict = dict[original_selector_name];
318318
NSMutableDictionary *selector_implementation_names_per_selector_;
319319

gma/integration_test/src/integration_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ TEST_F(FirebaseGmaUITest, TestRewardedAdLoadAndShow) {
10501050
LogDebug("Waiting for a moment to ensure all callbacks are recorded.");
10511051
app_framework::ProcessEvents(2000);
10521052

1053-
// If not running the UI test in CI (running mannually), keep this check.
1053+
// If not running the UI test in CI (running manually), keep this check.
10541054
// Else running the UI test in CI, skip this check.
10551055
if (!ShouldRunUITests()) {
10561056
EXPECT_EQ(content_listener.num_ad_clicked(), 1);

gma/src/android/ad_request_converter.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
#include "app/src/log.h"
3030
#include "app/src/util_android.h"
31-
#include "gma/gma_resources.h"
3231
#include "gma/src/android/gma_android.h"
3332
#include "gma/src/common/gma_common.h"
3433
#include "gma/src/include/firebase/gma.h"

gma/src/android/ad_request_converter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace gma {
3232
/// AdRequest.
3333
/// @param[out] error kAdErrorCodeNone on success, or another error if
3434
/// problems occurred.
35-
/// @return On succes, a local reference to an Android object representing the
35+
/// @return On success, a local reference to an Android object representing the
3636
/// AdRequest, or nullptr on error.
3737
jobject GetJavaAdRequestFromCPPAdRequest(const AdRequest& request,
3838
gma::AdErrorCode* error);

gma/src/android/ad_view_internal_android.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#include "app/src/assert.h"
2727
#include "app/src/util_android.h"
28-
#include "gma/gma_resources.h"
2928
#include "gma/src/android/ad_request_converter.h"
3029
#include "gma/src/android/gma_android.h"
3130
#include "gma/src/common/gma_common.h"
@@ -108,9 +107,9 @@ struct NulleryInvocationOnMainThreadData {
108107

109108
AdViewInternalAndroid::AdViewInternalAndroid(AdView* base)
110109
: AdViewInternal(base),
110+
destroyed_(false),
111111
helper_(nullptr),
112-
initialized_(false),
113-
destroyed_(false) {
112+
initialized_(false) {
114113
firebase::MutexLock lock(mutex_);
115114

116115
JNIEnv* env = ::firebase::gma::GetJNI();

gma/src/android/gma_android.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ static AdapterInitializationStatus PopulateAdapterInitializationStatus(
246246
}
247247

248248
// Initializes the Google Mobile Ads SDK using the MobileAds.initialize()
249-
// method. The GMA app ID is retreived from the App's android manifest.
249+
// method. The GMA app ID is retrieved from the App's android manifest.
250250
Future<AdapterInitializationStatus> InitializeGoogleMobileAds(JNIEnv* env) {
251251
Future<AdapterInitializationStatus> future_to_return;
252252
{
@@ -622,7 +622,6 @@ void CallOpenAdInspector(void* data) {
622622
OpenAdInspectorCallData* call_data =
623623
reinterpret_cast<OpenAdInspectorCallData*>(data);
624624
JNIEnv* env = firebase::util::GetThreadsafeJNIEnv(call_data->vm);
625-
bool jni_env_exists = (env != nullptr);
626625
jlong jlistener = (jlong)call_data->listener;
627626

628627
jobject ad_inspector_helper_ref = env->NewObject(
@@ -653,7 +652,7 @@ void OpenAdInspector(AdParent parent, AdInspectorClosedListener* listener) {
653652
call_data->ad_parent = env->NewGlobalRef(parent);
654653
call_data->listener = listener;
655654
jobject activity = ::firebase::gma::GetActivity();
656-
util::RunOnMainThread(env, g_activity, CallOpenAdInspector, call_data);
655+
util::RunOnMainThread(env, activity, CallOpenAdInspector, call_data);
657656
}
658657

659658
void SetIsSameAppKeyEnabled(bool is_enabled) {}
@@ -816,8 +815,9 @@ AdValue::PrecisionType ConvertAndroidPrecisionTypeToCPPPrecisionType(
816815
default:
817816
LogWarning("Could not convert AdValue precisionType: %l",
818817
j_precision_type);
818+
return AdValue::kAdValuePrecisionUnknown;
819819
case 0:
820-
return AdValue::kdValuePrecisionUnknown;
820+
return AdValue::kAdValuePrecisionUnknown;
821821
case 1: // ESTIMATED
822822
return AdValue::kAdValuePrecisionEstimated;
823823
case 2: // PUBLISHER_PROVIDED
@@ -1216,10 +1216,10 @@ jobject CreateJavaAdSize(JNIEnv* env, jobject j_activity,
12161216
ad_size::GetMethodId(
12171217
ad_size::kGetCurrentOrientationAnchoredAdaptiveBannerAdSize),
12181218
j_activity, adsize.width());
1219-
1219+
break;
12201220
default:
12211221
FIREBASE_ASSERT_MESSAGE(true,
1222-
"Uknown Anchor Adaptive AdSize Orientation");
1222+
"Unknown Anchor Adaptive AdSize Orientation");
12231223
}
12241224
break;
12251225
case AdSize::kTypeInlineAdaptive:
@@ -1253,7 +1253,7 @@ jobject CreateJavaAdSize(JNIEnv* env, jobject j_activity,
12531253
break;
12541254
default:
12551255
FIREBASE_ASSERT_MESSAGE(
1256-
true, "Uknown Inline Adaptive AdSize Orientation");
1256+
true, "Unknown Inline Adaptive AdSize Orientation");
12571257
}
12581258
}
12591259
break;
@@ -1263,7 +1263,7 @@ jobject CreateJavaAdSize(JNIEnv* env, jobject j_activity,
12631263
adsize.width(), adsize.height());
12641264
break;
12651265
default:
1266-
FIREBASE_ASSERT_MESSAGE(true, "Uknown AdSize Type");
1266+
FIREBASE_ASSERT_MESSAGE(true, "Unknown AdSize Type");
12671267
}
12681268
bool jni_exception = util::CheckAndClearJniExceptions(env);
12691269
FIREBASE_ASSERT(!jni_exception);

gma/src/android/gma_android.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ METHOD_LOOKUP_DECLARATION(gma_initialization_helper,
175175
// Needed when GMA is initialized without Firebase.
176176
JNIEnv* GetJNI();
177177

178-
// Retrieves the activity used to initalize GMA.
178+
// Retrieves the activity used to initialize GMA.
179179
jobject GetActivity();
180180

181181
// Register the native callbacks needed by the Futures.

gma/src/android/interstitial_ad_internal_android.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
#include "app/src/assert.h"
2626
#include "app/src/util_android.h"
27-
#include "gma/gma_resources.h"
2827
#include "gma/src/android/ad_request_converter.h"
2928
#include "gma/src/android/gma_android.h"
3029
#include "gma/src/common/gma_common.h"

gma/src/android/response_info_android.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ ResponseInfo::ResponseInfo(const ResponseInfoInternal& response_info_internal) {
5151
const int list_size = (int)env->CallIntMethod(
5252
j_adapter_response_info_list, util::list::GetMethodId(util::list::kSize));
5353
for (int i = 0; i < list_size; ++i) {
54-
// AdatperResponseInfo for this adapter.
54+
// AdapterResponseInfo for this adapter.
5555
jobject j_adapter_response_info =
5656
env->CallObjectMethod(j_adapter_response_info_list,
5757
util::list::GetMethodId(util::list::kGet), i);

gma/src/android/rewarded_ad_internal_android.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
#include "app/src/assert.h"
2626
#include "app/src/util_android.h"
27-
#include "gma/gma_resources.h"
2827
#include "gma/src/android/ad_request_converter.h"
2928
#include "gma/src/android/gma_android.h"
3029
#include "gma/src/common/gma_common.h"

0 commit comments

Comments
 (0)