Apply fixes from clag-tidy misc-unused-parameters (#1293)

Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1293

X-link: https://github.com/facebook/react-native/pull/37384

Gets the project mostly clean of `-Wunused-parameter`, part of `-Wextra`.

Reviewed By: yungsters

Differential Revision: D45772554

fbshipit-source-id: db4c4d2bd222debef178c4c16f7b60fb6c8db2a2
This commit is contained in:
Nick Gerleman
2023-05-11 09:43:36 -07:00
committed by Facebook GitHub Bot
parent 9e1b14cd9e
commit a97dbecb49
9 changed files with 139 additions and 127 deletions

View File

@@ -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};
}

View File

@@ -10,7 +10,7 @@
#include <yoga/Yoga.h>
static YGSize _measure(
YGNodeRef node,
YGNodeRef /*node*/,
float width,
YGMeasureMode widthMode,
float height,

View File

@@ -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;
}

View File

@@ -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(

View File

@@ -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)++;

View File

@@ -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)++;
@@ -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};
}
@@ -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);
@@ -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};
}

View File

@@ -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};
}

View File

@@ -10,11 +10,11 @@
#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,
@@ -22,11 +22,11 @@ static YGSize _measureFloor(
}
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,
@@ -34,11 +34,11 @@ static YGSize _measureCeil(
}
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,