From a4212061d4799482e569973fe4736e56cb3aefde Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Sat, 6 Apr 2024 20:12:15 +0200 Subject: [PATCH] Cleanup some unused variables --- audio/drivers/coreaudio.c | 2 +- cheat_manager.c | 3 --- deps/glslang/glslang/SPIRV/GlslangToSpv.cpp | 15 +++++---------- .../glslang/MachineIndependent/glslang_tab.cpp | 5 ----- deps/mbedtls/bignum.c | 4 +--- gfx/drivers_font_renderer/coretext.c | 12 ++++++------ input/connect/joypad_connection.c | 18 +++++++++--------- tasks/task_translation.c | 2 ++ 8 files changed, 24 insertions(+), 37 deletions(-) diff --git a/audio/drivers/coreaudio.c b/audio/drivers/coreaudio.c index 5ae9a12da4..b950937f7d 100644 --- a/audio/drivers/coreaudio.c +++ b/audio/drivers/coreaudio.c @@ -153,7 +153,7 @@ static void choose_output_device(coreaudio_t *dev, const char* device) #endif propaddr.mSelector = kAudioDevicePropertyDeviceName; - for (i = 0; i < deviceCount; i ++) + for (i = 0; i < (int)deviceCount; i ++) { char device_name[1024]; device_name[0] = 0; diff --git a/cheat_manager.c b/cheat_manager.c index 741c30532c..f68f477910 100644 --- a/cheat_manager.c +++ b/cheat_manager.c @@ -1216,7 +1216,6 @@ int cheat_manager_add_matches(const char *path, unsigned int bytes_per_item = 1; unsigned int bits = 8; unsigned int curr_val = 0; - unsigned int num_added = 0; unsigned int offset = 0; cheat_manager_t *cheat_st = &cheat_manager_state; unsigned char *curr = cheat_st->curr_memory_buf; @@ -1267,7 +1266,6 @@ int cheat_manager_add_matches(const char *path, runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADDED_MATCHES_FAIL), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); return 0; } - num_added++; } } else @@ -1281,7 +1279,6 @@ int cheat_manager_add_matches(const char *path, runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADDED_MATCHES_FAIL), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); return 0; } - num_added++; } } diff --git a/deps/glslang/glslang/SPIRV/GlslangToSpv.cpp b/deps/glslang/glslang/SPIRV/GlslangToSpv.cpp index 0d64834e55..e59fd923ee 100755 --- a/deps/glslang/glslang/SPIRV/GlslangToSpv.cpp +++ b/deps/glslang/glslang/SPIRV/GlslangToSpv.cpp @@ -731,7 +731,7 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI builder.addExtension(spv::E_SPV_EXT_fragment_fully_covered); builder.addCapability(spv::CapabilityFragmentFullyCoveredEXT); return spv::BuiltInFullyCoveredEXT; -#endif +#endif default: return spv::BuiltInMax; } @@ -2101,7 +2101,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt break; case 1: { - OpDecorations decorations = { precision, + OpDecorations decorations = { precision, TranslateNoContractionDecoration(node->getType().getQualifier()), TranslateNonUniformDecoration(node->getType().getQualifier()) }; result = createUnaryOperation( @@ -2204,7 +2204,7 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang // smear condition to vector, if necessary (AST is always scalar) if (builder.isVector(trueValue)) - condition = builder.smearScalar(spv::NoPrecision, condition, + condition = builder.smearScalar(spv::NoPrecision, condition, builder.makeVectorType(builder.makeBoolType(), builder.getNumComponents(trueValue))); @@ -2830,7 +2830,6 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, { // Name and decorate the non-hidden members int offset = -1; - int locationOffset = 0; // for use within the members of this struct for (int i = 0; i < (int)glslangMembers->size(); i++) { glslang::TType& glslangMember = *(*glslangMembers)[i].type; int member = i; @@ -2880,10 +2879,6 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, if (! type.isArray() && memberQualifier.hasLocation()) builder.addMemberDecoration(spvType, member, spv::DecorationLocation, memberQualifier.layoutLocation); - if (qualifier.hasLocation()) // track for upcoming inheritance - locationOffset += glslangIntermediate->computeTypeLocationSize( - glslangMember, glslangIntermediate->getStage()); - // component, XFB, others if (glslangMember.getQualifier().hasComponent()) builder.addMemberDecoration(spvType, member, spv::DecorationComponent, @@ -3940,7 +3935,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } } - std::vector result( 1, + std::vector result( 1, builder.createTextureCall(precision, resultType(), sparse, cracked.fetch, cracked.proj, cracked.gather, noImplicitLod, params) ); @@ -6913,7 +6908,7 @@ void OutputSpvHex(const std::vector& spirv, const char* baseName, out.open(baseName, std::ios::binary | std::ios::out); if (out.fail()) printf("ERROR: Failed to open file: %s\n", baseName); - out << "\t// " << + out << "\t// " << glslang::GetSpirvGeneratorVersion() << "." << GLSLANG_MINOR_VERSION << "." << GLSLANG_PATCH_LEVEL << std::endl; if (varName != nullptr) { diff --git a/deps/glslang/glslang/glslang/MachineIndependent/glslang_tab.cpp b/deps/glslang/glslang/glslang/MachineIndependent/glslang_tab.cpp index 38672d67d3..25523309eb 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/glslang_tab.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/glslang_tab.cpp @@ -3772,9 +3772,6 @@ int yychar; YY_INITIAL_VALUE (static YYSTYPE yyval_default;) YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); - /* Number of syntax errors so far. */ - int yynerrs; - int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; @@ -3827,7 +3824,6 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yystate = 0; yyerrstatus = 0; - yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; @@ -9867,7 +9863,6 @@ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { - ++yynerrs; #if ! YYERROR_VERBOSE yyerror (pParseContext, YY_("syntax error")); #else diff --git a/deps/mbedtls/bignum.c b/deps/mbedtls/bignum.c index d887d2928a..aa98e21047 100644 --- a/deps/mbedtls/bignum.c +++ b/deps/mbedtls/bignum.c @@ -1101,7 +1101,7 @@ __attribute__ ((noinline)) #endif void mpi_mul_hlp( size_t i, mbedtls_mpi_uint *s, mbedtls_mpi_uint *d, mbedtls_mpi_uint b ) { - mbedtls_mpi_uint c = 0, t = 0; + mbedtls_mpi_uint c = 0; #if defined(MULADDC_HUIT) for( ; i >= 8; i -= 8 ) @@ -1152,8 +1152,6 @@ void mpi_mul_hlp( size_t i, mbedtls_mpi_uint *s, mbedtls_mpi_uint *d, mbedtls_mp } #endif /* MULADDC_HUIT */ - t++; - do { *d += c; c = ( *d < c ); d++; } diff --git a/gfx/drivers_font_renderer/coretext.c b/gfx/drivers_font_renderer/coretext.c index ce6e5bcc17..d46a99c577 100644 --- a/gfx/drivers_font_renderer/coretext.c +++ b/gfx/drivers_font_renderer/coretext.c @@ -160,7 +160,7 @@ static bool coretext_font_renderer_create_atlas(CTFontRef face, ct_font_renderer handle->atlas.width = max_width * CT_ATLAS_COLS; handle->atlas.height = max_height * CT_ATLAS_ROWS; - + handle->line_metrics.ascender = (float)CTFontGetAscent(face); handle->line_metrics.descender = (float)CTFontGetDescent(face); /* CTFontGetDescent() should return a positive value, @@ -196,11 +196,11 @@ static bool coretext_font_renderer_create_atlas(CTFontRef face, ct_font_renderer { unsigned offset_x, offset_y, r, c; char glyph_cstr[2]; - const uint8_t *src; - uint8_t *dst; - CTLineRef line; CFStringRef glyph_cfstr; CFAttributedStringRef attrString; + CTLineRef line = NULL; + const uint8_t *src = NULL; + uint8_t *dst = NULL; struct font_glyph *glyph = &handle->atlas_slots[i].glyph; if (!glyph) @@ -239,9 +239,9 @@ static bool coretext_font_renderer_create_atlas(CTFontRef face, ct_font_renderer dst = (uint8_t*)handle->atlas.buffer; src = (const uint8_t*)bitmapData; - for (r = 0; r < max_height; r++) + for (r = 0; r < (unsigned)max_height; r++) { - for (c = 0; c < max_width; c++) + for (c = 0; c < (unsigned)max_width; c++) { unsigned src_idx = (unsigned)(r * bytesPerRow + c); unsigned dest_idx = diff --git a/input/connect/joypad_connection.c b/input/connect/joypad_connection.c index 3eb4316676..d4108f6604 100644 --- a/input/connect/joypad_connection.c +++ b/input/connect/joypad_connection.c @@ -151,7 +151,7 @@ joypad_connection_t *pad_connection_init(unsigned pads) if (!(joyconn = (joypad_connection_t*)calloc(pads+1, sizeof(joypad_connection_t)))) return NULL; - for (i = 0; i < pads; i++) + for (i = 0; i < (int)pads; i++) { joypad_connection_t *conn = (joypad_connection_t*)&joyconn[i]; @@ -240,7 +240,7 @@ void legacy_pad_connection_pad_deregister(joypad_connection_t *pad_list, pad_con void pad_connection_pad_deregister(joypad_connection_t *joyconn, pad_connection_interface_t *iface, void *pad_data) { - int i; + int i; if (!iface || !iface->multi_pad) { @@ -279,7 +279,7 @@ void pad_connection_pad_refresh(joypad_connection_t *joyconn, state = iface->status(device_data, i); switch(state) { - /* The pad slot is bound to a joypad + /* The pad slot is bound to a joypad that's no longer connected */ case PAD_CONNECT_BOUND: joypad = iface->joypad(device_data, i); @@ -334,14 +334,14 @@ void pad_connection_pad_register(joypad_connection_t *joyconn, for (i = 0; i < max_pad; i++) { - int status = iface->multi_pad - ? iface->status(device_data, i) + int status = iface->multi_pad + ? iface->status(device_data, i) : PAD_CONNECT_READY; if (status == PAD_CONNECT_READY) { void *connection = NULL; - int found_slot = (slot == SLOT_AUTO) - ? pad_connection_find_vacant_pad(joyconn) + int found_slot = (slot == SLOT_AUTO) + ? pad_connection_find_vacant_pad(joyconn) : slot; if (found_slot < 0) continue; @@ -383,7 +383,7 @@ int32_t pad_connection_pad_init_entry(joypad_connection_t *joyconn, } else { - /* We failed to find a matching pad. + /* We failed to find a matching pad. * Set up one without an interface */ RARCH_DBG("Pad was not matched. Setting up without an interface.\n"); conn->iface = NULL; @@ -429,7 +429,7 @@ void pad_connection_packet(joypad_connection_t *joyconn, uint32_t pad, { if ( joyconn && joyconn->connected - && joyconn->connection + && joyconn->connection && joyconn->iface && joyconn->iface->packet_handler) joyconn->iface->packet_handler(joyconn->connection, data, length); diff --git a/tasks/task_translation.c b/tasks/task_translation.c index b8c8224eb8..da3212c2b8 100644 --- a/tasks/task_translation.c +++ b/tasks/task_translation.c @@ -393,6 +393,7 @@ static INLINE bool translation_user_error(const char *message) return translation_user_message(message, true); } +#if 0 /** * Displays the given message on screen and returns true. Returns false if no * {message} is provided (i.e. it is NULL). The message will be displayed as @@ -403,6 +404,7 @@ static INLINE bool translation_user_info(const char *message) { return translation_user_message(message, false); } +#endif /** * Displays the given hash on screen and returns true. Returns false if no