Skip to content

Commit

Permalink
Apply fixes from clag-tidy misc-unused-parameters
Browse files Browse the repository at this point in the history
Summary: Gets the project clean of `-Wunused-parameter`, part of `-Wextra`. Enforced as part of the build now.

Differential Revision: https://internalfb.com/D45772554

fbshipit-source-id: a06f00d55adab47a7d59d93069793e48824e498b
  • Loading branch information
NickGerleman authored and facebook-github-bot committed May 11, 2023
1 parent 9e1b14c commit 026b1dc
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 127 deletions.
153 changes: 81 additions & 72 deletions java/jni/YGJNIVanilla.cpp

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions tests/YGAlignBaselineTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@
#include <yoga/Yoga.h>

static float _baselineFunc(
YGNodeRef node,
const float width,
YGNodeRef /*node*/,
const float /*width*/,
const float height) {
return height / 2;
}

static YGSize _measure1(
YGNodeRef node,
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
YGNodeRef /*node*/,
float /*width*/,
YGMeasureMode /*widthMode*/,
float /*height*/,
YGMeasureMode /*heightMode*/) {
return YGSize{42, 50};
}

static YGSize _measure2(
YGNodeRef node,
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
YGNodeRef /*node*/,
float /*width*/,
YGMeasureMode /*widthMode*/,
float /*height*/,
YGMeasureMode /*heightMode*/) {
return YGSize{279, 126};
}

Expand Down
2 changes: 1 addition & 1 deletion tests/YGAspectRatioTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <yoga/Yoga.h>

static YGSize _measure(
YGNodeRef node,
YGNodeRef /*node*/,
float width,
YGMeasureMode widthMode,
float height,
Expand Down
5 changes: 4 additions & 1 deletion tests/YGBaselineFuncTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
#include <yoga/YGNode.h>
#include <yoga/Yoga.h>

static float _baseline(YGNodeRef node, const float width, const float height) {
static float _baseline(
YGNodeRef node,
const float /*width*/,
const float /*height*/) {
float* baseline = (float*) node->getContext();
return *baseline;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/YGLoggerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
namespace {
char writeBuffer[4096];
int _unmanagedLogger(
const YGConfigRef config,
const YGNodeRef node,
YGLogLevel level,
const YGConfigRef /*config*/,
const YGNodeRef /*node*/,
YGLogLevel /*level*/,
const char* format,
va_list args) {
return vsnprintf(
Expand Down
8 changes: 4 additions & 4 deletions tests/YGMeasureCacheTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ static YGSize _measureMin(

static YGSize _measure_84_49(
YGNodeRef node,
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
float /*width*/,
YGMeasureMode /*widthMode*/,
float /*height*/,
YGMeasureMode /*heightMode*/) {
int* measureCount = (int*) node->getContext();
if (measureCount) {
(*measureCount)++;
Expand Down
40 changes: 20 additions & 20 deletions tests/YGMeasureTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

static YGSize _measure(
YGNodeRef node,
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
float /*width*/,
YGMeasureMode /*widthMode*/,
float /*height*/,
YGMeasureMode /*heightMode*/) {
int* measureCount = (int*) node->getContext();
if (measureCount) {
(*measureCount)++;
Expand All @@ -24,11 +24,11 @@ static YGSize _measure(
}

static YGSize _simulate_wrapping_text(
YGNodeRef node,
YGNodeRef /*node*/,
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
float /*height*/,
YGMeasureMode /*heightMode*/) {
if (widthMode == YGMeasureModeUndefined || width >= 68) {
return YGSize{68, 16};
}
Expand All @@ -37,11 +37,11 @@ static YGSize _simulate_wrapping_text(
}

static YGSize _measure_assert_negative(
YGNodeRef node,
YGNodeRef /*node*/,
float width,
YGMeasureMode widthMode,
YGMeasureMode /*widthMode*/,
float height,
YGMeasureMode heightMode) {
YGMeasureMode /*heightMode*/) {
EXPECT_GE(width, 0);
EXPECT_GE(height, 0);

Expand Down Expand Up @@ -641,21 +641,21 @@ TEST(YogaTest, cant_call_negative_measure_horizontal) {
}

static YGSize _measure_90_10(
YGNodeRef node,
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
YGNodeRef /*node*/,
float /*width*/,
YGMeasureMode /*widthMode*/,
float /*height*/,
YGMeasureMode /*heightMode*/) {

return YGSize{90, 10};
}

static YGSize _measure_100_100(
YGNodeRef node,
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
YGNodeRef /*node*/,
float /*width*/,
YGMeasureMode /*widthMode*/,
float /*height*/,
YGMeasureMode /*heightMode*/) {

return YGSize{100, 100};
}
Expand Down
10 changes: 5 additions & 5 deletions tests/YGRoundingFunctionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ TEST(YogaTest, rounding_value) {
}

static YGSize measureText(
YGNodeRef node,
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
YGNodeRef /*node*/,
float /*width*/,
YGMeasureMode /*widthMode*/,
float /*height*/,
YGMeasureMode /*heightMode*/) {
return YGSize{10, 10};
}

Expand Down
18 changes: 9 additions & 9 deletions tests/YGRoundingMeasureFuncTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,35 @@
#include <yoga/Yoga.h>

static YGSize _measureFloor(
YGNodeRef node,
YGNodeRef /*node*/,
float width,
YGMeasureMode widthMode,
YGMeasureMode /*widthMode*/,
float height,
YGMeasureMode heightMode) {
YGMeasureMode /*heightMode*/) {
return YGSize{
width = 10.2f,
height = 10.2f,
};
}

static YGSize _measureCeil(
YGNodeRef node,
YGNodeRef /*node*/,
float width,
YGMeasureMode widthMode,
YGMeasureMode /*widthMode*/,
float height,
YGMeasureMode heightMode) {
YGMeasureMode /*heightMode*/) {
return YGSize{
width = 10.5f,
height = 10.5f,
};
}

static YGSize _measureFractial(
YGNodeRef node,
YGNodeRef /*node*/,
float width,
YGMeasureMode widthMode,
YGMeasureMode /*widthMode*/,
float height,
YGMeasureMode heightMode) {
YGMeasureMode /*heightMode*/) {
return YGSize{
width = 0.5f,
height = 0.5f,
Expand Down

0 comments on commit 026b1dc

Please sign in to comment.