Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ typedef NSURLSessionConfiguration * (^NSURLSessionConfigurationProvider)(void);
* The block provided via this function will provide the NSURLSessionConfiguration for all HTTP requests made by the
* app.
*/
RCT_EXTERN void RCTSetCustomNSURLSessionConfigurationProvider(NSURLSessionConfigurationProvider);
RCT_EXTERN void RCTSetCustomNSURLSessionConfigurationProvider(NSURLSessionConfigurationProvider /*provider*/);
/**
* This is the default RCTURLRequestHandler implementation for HTTP requests.
*/
Expand Down
9 changes: 7 additions & 2 deletions packages/react-native/React/Base/RCTAssert.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ RCT_EXTERN BOOL RCTIsMainQueue(void);
do { \
} while (false)
#endif
RCT_EXTERN void _RCTAssertFormat(const char *, const char *, int, const char *, NSString *, ...)
NS_FORMAT_FUNCTION(5, 6);
RCT_EXTERN void _RCTAssertFormat(
const char * /*condition*/,
const char * /*fileName*/,
int /*lineNumber*/,
const char * /*function*/,
NSString * /*format*/,
...) NS_FORMAT_FUNCTION(5, 6);

/**
* Report a fatal condition when executing. These calls will _NOT_ be compiled out
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/React/Base/RCTAssert.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
RCTFatalHandler RCTCurrentFatalHandler = nil;
RCTFatalExceptionHandler RCTCurrentFatalExceptionHandler = nil;

NSException *_RCTNotImplementedException(SEL, Class);
NSException *_RCTNotImplementedException(SEL /*cmd*/, Class /*cls*/);
NSException *_RCTNotImplementedException(SEL cmd, Class cls)
{
NSString *msg = [NSString stringWithFormat:
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native/React/Base/RCTBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
}

static NSMutableArray<NSString *> *modulesLoadedWithOldArch;
void addModuleLoadedWithOldArch(NSString *);
void addModuleLoadedWithOldArch(NSString * /*moduleName*/);
void addModuleLoadedWithOldArch(NSString *moduleName)
{
static dispatch_once_t onceToken;
Expand All @@ -138,7 +138,7 @@ void addModuleLoadedWithOldArch(NSString *moduleName)
* prior to the first bridge initialization.
* TODO: (T115656171) Refactor RCTRegisterModule out of Bridge.m since it doesn't use the Bridge.
*/
void RCTRegisterModule(Class);
void RCTRegisterModule(Class /*moduleClass*/);
void RCTRegisterModule(Class moduleClass)
{
if (RCTAreLegacyLogsEnabled() && ![getCoreModuleClasses() containsObject:[moduleClass description]]) {
Expand Down
11 changes: 8 additions & 3 deletions packages/react-native/React/Base/RCTConvert.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,14 @@ typedef NSArray UIColorArray __deprecated_msg("Use NSArray<UIColor *>");
/**
* Underlying implementations of RCT_XXX_CONVERTER macros. Ignore these.
*/
RCT_EXTERN NSNumber *RCTConvertEnumValue(const char *, NSDictionary *, NSNumber *, id);
RCT_EXTERN NSNumber *RCTConvertMultiEnumValue(const char *, NSDictionary *, NSNumber *, id);
RCT_EXTERN NSArray *RCTConvertArrayValue(SEL, id);
RCT_EXTERN NSNumber *
RCTConvertEnumValue(const char * /*typeName*/, NSDictionary * /*mapping*/, NSNumber * /*defaultValue*/, id /*json*/);
RCT_EXTERN NSNumber *RCTConvertMultiEnumValue(
const char * /*typeName*/,
NSDictionary * /*mapping*/,
NSNumber * /*defaultValue*/,
id /*json*/);
RCT_EXTERN NSArray *RCTConvertArrayValue(SEL /*type*/, id /*json*/);

/**
* This macro is used for logging conversion errors. This is just used to
Expand Down
10 changes: 6 additions & 4 deletions packages/react-native/React/Base/RCTLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ RCTFormatLog(NSDate *timestamp, RCTLogLevel level, NSString *fileName, NSNumber
/**
* A method to generate a string RCTLogLevel
*/
RCT_EXTERN NSString *RCTFormatLogLevel(RCTLogLevel);
RCT_EXTERN NSString *RCTFormatLogLevel(RCTLogLevel /*level*/);

/**
* A method to generate a string from a RCTLogSource
*/
RCT_EXTERN NSString *RCTFormatLogSource(RCTLogSource);
RCT_EXTERN NSString *RCTFormatLogSource(RCTLogSource /*source*/);

/**
* The default logging function used by RCTLogXX.
Expand Down Expand Up @@ -149,5 +149,7 @@ RCT_EXTERN void RCTLogSetBridgelessCallableJSModules(RCTCallableJSModules *calla
} while (0)
#endif

RCT_EXTERN void _RCTLogNativeInternal(RCTLogLevel, const char *, int, NSString *, ...) NS_FORMAT_FUNCTION(4, 5);
RCT_EXTERN void _RCTLogJavaScriptInternal(RCTLogLevel, NSString *);
RCT_EXTERN void
_RCTLogNativeInternal(RCTLogLevel /*level*/, const char * /*fileName*/, int /*lineNumber*/, NSString * /*format*/, ...)
NS_FORMAT_FUNCTION(4, 5);
RCT_EXTERN void _RCTLogJavaScriptInternal(RCTLogLevel /*level*/, NSString * /*message*/);
2 changes: 1 addition & 1 deletion packages/react-native/React/Base/RCTUtils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ BOOL RCTForceTouchAvailable(void)
[data base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)0]]];
}

BOOL RCTIsGzippedData(NSData *__nullable); // exposed for unit testing purposes
BOOL RCTIsGzippedData(NSData *__nullable /*data*/); // exposed for unit testing purposes
BOOL RCTIsGzippedData(NSData *__nullable data)
{
UInt8 *bytes = (UInt8 *)data.bytes;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/React/CoreModules/RCTAppearance.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#import <React/RCTEventEmitter.h>

RCT_EXTERN void RCTEnableAppearancePreference(BOOL enabled);
RCT_EXTERN void RCTOverrideAppearancePreference(NSString *);
RCT_EXTERN void RCTOverrideAppearancePreference(NSString * /*colorSchemeOverride*/);
RCT_EXTERN void RCTUseKeyWindowForSystemStyle(BOOL useMainScreen);
RCT_EXTERN NSString *RCTCurrentOverrideAppearancePreference(void);
RCT_EXTERN NSString *RCTColorSchemePreference(UITraitCollection *traitCollection);
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native/React/CxxBridge/RCTMessageThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class RCTMessageThread : public MessageQueueThread,
public:
RCTMessageThread(NSRunLoop* runLoop, RCTJavaScriptCompleteBlock errorBlock);
~RCTMessageThread() override;
void runOnQueue(std::function<void()>&&) override;
void runOnQueueSync(std::function<void()>&&) override;
void runOnQueue(std::function<void()>&& /*func*/) override;
void runOnQueueSync(std::function<void()>&& /*func*/) override;
void quitSynchronous() override;
void setRunLoop(NSRunLoop* runLoop);

Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/React/CxxBridge/RCTObjcExecutor.mm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void loadBundle(std::unique_ptr<const JSBigString> script, std::string sourceURL
}];
}

void setBundleRegistry(std::unique_ptr<RAMBundleRegistry>) override
void setBundleRegistry(std::unique_ptr<RAMBundleRegistry> /*bundleRegistry*/) override
{
RCTAssert(NO, @"RAM bundles are not supported in RCTObjcExecutor");
}
Expand Down
12 changes: 6 additions & 6 deletions packages/react-native/React/Profiler/RCTProfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ RCT_EXTERN dispatch_queue_t RCTProfileGetQueue(void)

RCT_EXTERN NSUInteger _RCTProfileBeginFlowEvent(void)
__deprecated_msg("This API will be removed along with the legacy architecture.");
RCT_EXTERN void _RCTProfileEndFlowEvent(NSUInteger)
RCT_EXTERN void _RCTProfileEndFlowEvent(NSUInteger /*cookie*/)
__deprecated_msg("This API will be removed along with the legacy architecture.");

/**
Expand All @@ -55,15 +55,15 @@ RCT_EXTERN BOOL RCTProfileIsProfiling(void)
/**
* Start collecting profiling information
*/
RCT_EXTERN void RCTProfileInit(RCTBridge *)
RCT_EXTERN void RCTProfileInit(RCTBridge * /*bridge*/)
__deprecated_msg("This API will be removed along with the legacy architecture.");

/**
* Stop profiling and return a JSON string of the collected data - The data
* returned is compliant with google's trace event format - the format used
* as input to trace-viewer
*/
RCT_EXTERN void RCTProfileEnd(RCTBridge *, void (^)(NSString *))
RCT_EXTERN void RCTProfileEnd(RCTBridge * /*bridge*/, void (^/*callback*/)(NSString *))
__deprecated_msg("This API will be removed along with the legacy architecture.");

/**
Expand Down Expand Up @@ -164,13 +164,13 @@ RCT_EXTERN void RCTProfileImmediateEvent(uint64_t tag, NSString *name, NSTimeInt
/**
* Hook into a bridge instance to log all bridge module's method calls
*/
RCT_EXTERN void RCTProfileHookModules(RCTBridge *)
RCT_EXTERN void RCTProfileHookModules(RCTBridge * /*bridge*/)
__deprecated_msg("This API will be removed along with the legacy architecture.");

/**
* Unhook from a given bridge instance's modules
*/
RCT_EXTERN void RCTProfileUnhookModules(RCTBridge *)
RCT_EXTERN void RCTProfileUnhookModules(RCTBridge * /*bridge*/)
__deprecated_msg("This API will be removed along with the legacy architecture.");

/**
Expand Down Expand Up @@ -215,7 +215,7 @@ typedef struct {
void (*end_async_flow)(uint64_t tag, const char *name, int cookie);
} RCTProfileCallbacks __deprecated_msg("This API will be removed along with the legacy architecture.");

RCT_EXTERN void RCTProfileRegisterCallbacks(RCTProfileCallbacks *)
RCT_EXTERN void RCTProfileRegisterCallbacks(RCTProfileCallbacks * /*cb*/)
__deprecated_msg("This API will be removed along with the legacy architecture.");

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/React/Profiler/RCTProfile.m
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ IMP RCTProfileGetImplementation(id obj, SEL cmd)
static void *RCTProfileTrampoline = NULL;
#endif

RCT_EXTERN void RCTProfileTrampolineStart(id, SEL);
RCT_EXTERN void RCTProfileTrampolineStart(id /*self*/, SEL /*cmd*/);
void RCTProfileTrampolineStart(id self, SEL cmd)
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class JCxxInspectorPackagerConnection
jni::alias_ref<JDelegateImpl::javaobject> delegate);

static jni::local_ref<jhybriddata> initHybrid(
jni::alias_ref<jclass>,
jni::alias_ref<jclass> /*unused*/,
const std::string& url,
const std::string& deviceName,
const std::string& packageName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class JInspectorFlags : public jni::JavaClass<JInspectorFlags> {
static constexpr auto kJavaDescriptor =
"Lcom/facebook/react/devsupport/InspectorFlags;";

static bool getFuseboxEnabled(jni::alias_ref<jclass>);
static bool getIsProfilingBuild(jni::alias_ref<jclass>);
static bool getFuseboxEnabled(jni::alias_ref<jclass> /*unused*/);
static bool getIsProfilingBuild(jni::alias_ref<jclass> /*unused*/);

static void registerNatives();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class ComponentFactory : public jni::HybridClass<ComponentFactory> {
ComponentRegistryFactory buildRegistryFunction;

private:
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jclass>);
static jni::local_ref<jhybriddata> initHybrid(
jni::alias_ref<jclass> /*unused*/);
};

} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class HermesSamplingProfiler : public jni::JavaClass<HermesSamplingProfiler> {
public:
constexpr static auto kJavaDescriptor =
"Lcom/facebook/hermes/instrumentation/HermesSamplingProfiler;";
static void enable(jni::alias_ref<jclass>);
static void disable(jni::alias_ref<jclass>);
static void enable(jni::alias_ref<jclass> /*unused*/);
static void disable(jni::alias_ref<jclass> /*unused*/);
static void dumpSampledTraceToFile(
jni::alias_ref<jclass>,
jni::alias_ref<jclass> /*unused*/,
const std::string& filename);

static void registerNatives();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class [[deprecated(
static constexpr auto kJavaDescriptor =
"Lcom/facebook/react/bridge/CatalystInstanceImpl;";

static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jclass>);
static jni::local_ref<jhybriddata> initHybrid(
jni::alias_ref<jclass> /*unused*/);

static void registerNatives();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ReactInstanceManagerInspectorTarget
jsinspector_modern::HostTargetMetadata getMetadata() override;
void onReload(const PageReloadRequest& request) override;
void onSetPausedInDebuggerMessage(
const OverlaySetPausedInDebuggerMessageRequest&) override;
const OverlaySetPausedInDebuggerMessageRequest& /*request*/) override;
void loadNetworkResource(
const jsinspector_modern::LoadNetworkResourceRequest& params,
jsinspector_modern::ScopedExecutor<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class DefaultComponentsRegistry

private:
static void setRegistryRunction(
jni::alias_ref<jclass>,
jni::alias_ref<jclass> /*unused*/,
ComponentFactory* delegate);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ class DefaultTurboModuleManagerDelegate : public jni::HybridClass<
"Lcom/facebook/react/defaults/DefaultTurboModuleManagerDelegate;";

static jni::local_ref<jhybriddata> initHybrid(
jni::alias_ref<jclass>,
jni::alias_ref<jni::JList<CxxReactPackage::javaobject>::javaobject>);
jni::alias_ref<jclass> /*unused*/,
jni::alias_ref<jni::JList<
CxxReactPackage::javaobject>::javaobject> /*cxxReactPackages*/);

static void registerNatives();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class BlobCollector : public jni::HybridClass<BlobCollector>,
"Lcom/facebook/react/modules/blob/BlobCollector;";

static void nativeInstall(
jni::alias_ref<jclass>,
jni::alias_ref<jclass> /*unused*/,
jni::alias_ref<jobject> blobModule,
jlong jsContextNativePointer);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class JReactInstance : public jni::HybridClass<JReactInstance> {
"Lcom/facebook/react/runtime/ReactInstance;";

static jni::local_ref<jhybriddata> initHybrid(
jni::alias_ref<jhybridobject>,
jni::alias_ref<jhybridobject> /*unused*/,
jni::alias_ref<JJSRuntimeFactory::javaobject> jsRuntimeFactory,
jni::alias_ref<JavaMessageQueueThread::javaobject> jsMessageQueueThread,
jni::alias_ref<JavaMessageQueueThread::javaobject>
Expand Down
8 changes: 4 additions & 4 deletions packages/react-native/ReactCommon/cxxreact/CxxModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class CxxModule {
Method(
std::string aname,
std::function<void(folly::dynamic, Callback, Callback)>&& afunc,
AsyncTagType)
AsyncTagType /*unused*/)
: name(std::move(aname)),
callbacks(2),
isPromise(false),
Expand Down Expand Up @@ -163,7 +163,7 @@ class CxxModule {
std::string aname,
T* t,
void (T::*method)(folly::dynamic, Callback, Callback),
AsyncTagType)
AsyncTagType /*unused*/)
: name(std::move(aname)),
callbacks(2),
isPromise(false),
Expand All @@ -183,7 +183,7 @@ class CxxModule {
Method(
std::string aname,
std::function<folly::dynamic()>&& afunc,
SyncTagType)
SyncTagType /*unused*/)
: name(std::move(aname)),
callbacks(0),
isPromise(false),
Expand All @@ -194,7 +194,7 @@ class CxxModule {
Method(
std::string aname,
std::function<folly::dynamic(folly::dynamic)>&& afunc,
SyncTagType)
SyncTagType /*unused*/)
: name(std::move(aname)),
callbacks(0),
isPromise(false),
Expand Down
Loading
Loading