diff --git a/submodules/LegacyComponents/Sources/PGCameraCaptureSession.m b/submodules/LegacyComponents/Sources/PGCameraCaptureSession.m index 6770cc9449..b78f0929bd 100644 --- a/submodules/LegacyComponents/Sources/PGCameraCaptureSession.m +++ b/submodules/LegacyComponents/Sources/PGCameraCaptureSession.m @@ -322,11 +322,13 @@ const NSInteger PGCameraFrameRate = 30; - (void)switchToBestVideoFormatForDevice:(AVCaptureDevice *)device { + __unused bool preferZoomableFormat = [self hasTelephotoCamera] || [self hasUltrawideCamera]; [self _reconfigureDevice:device withBlock:^(AVCaptureDevice *device) { NSArray *availableFormats = device.formats; AVCaptureDeviceFormat *preferredFormat = nil; NSMutableArray *maybeFormats = nil; + bool hasSecondaryZoomLevels = false; int32_t maxWidth = 0; int32_t maxHeight = 0; for (AVCaptureDeviceFormat *format in availableFormats) @@ -338,6 +340,7 @@ const NSInteger PGCameraFrameRate = 30; if (dimensions.width >= maxWidth && dimensions.width <= 1920 && dimensions.height >= maxHeight && dimensions.height <= 1080) { if (dimensions.width > maxWidth) { + hasSecondaryZoomLevels = false; maybeFormats = [[NSMutableArray alloc] init]; } FourCharCode mediaSubType = CMFormatDescriptionGetMediaSubType(format.formatDescription); @@ -359,12 +362,15 @@ const NSInteger PGCameraFrameRate = 30; if (supportedRate) { if (@available(iOS 16.0, *)) { if (format.secondaryNativeResolutionZoomFactors.count > 0) { + hasSecondaryZoomLevels = true; [maybeFormats addObject:format]; - } else { + } else if (!hasSecondaryZoomLevels) { [maybeFormats addObject:format]; } } else { - [maybeFormats addObject:format]; + if (!hasSecondaryZoomLevels) { + [maybeFormats addObject:format]; + } } } } diff --git a/submodules/LegacyComponents/Sources/TGAuthorSignatureMediaAttachment.m b/submodules/LegacyComponents/Sources/TGAuthorSignatureMediaAttachment.m index dafb13c1d3..4cd356c201 100644 --- a/submodules/LegacyComponents/Sources/TGAuthorSignatureMediaAttachment.m +++ b/submodules/LegacyComponents/Sources/TGAuthorSignatureMediaAttachment.m @@ -36,7 +36,11 @@ { int32_t length = [is readInt32]; NSData *data = [is readData:length]; - return [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaAttachment class] fromData:data error:nil]; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [NSKeyedUnarchiver unarchiveObjectWithData:data]; +#pragma clang diagnostic pop } - (BOOL)isEqual:(id)object { diff --git a/submodules/LegacyComponents/Sources/TGBotContextResultAttachment.m b/submodules/LegacyComponents/Sources/TGBotContextResultAttachment.m index 9c777b0ca6..bd97cf7b3b 100644 --- a/submodules/LegacyComponents/Sources/TGBotContextResultAttachment.m +++ b/submodules/LegacyComponents/Sources/TGBotContextResultAttachment.m @@ -38,7 +38,10 @@ { int32_t length = [is readInt32]; NSData *data = [is readData:length]; - return [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaAttachment class] fromData:data error:nil]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [NSKeyedUnarchiver unarchiveObjectWithData:data]; +#pragma clang diagnostic pop } @end diff --git a/submodules/LegacyComponents/Sources/TGDocumentMediaAttachment.m b/submodules/LegacyComponents/Sources/TGDocumentMediaAttachment.m index b44e536cba..25cd3e5635 100644 --- a/submodules/LegacyComponents/Sources/TGDocumentMediaAttachment.m +++ b/submodules/LegacyComponents/Sources/TGDocumentMediaAttachment.m @@ -286,7 +286,10 @@ NSData *data = [[NSData alloc] initWithBytesNoCopy:originBytes length:originLength freeWhenDone:true]; TGMediaOriginInfo *origin = nil; @try { - origin = [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaOriginInfo class] fromData:data error:nil]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + origin = [NSKeyedUnarchiver unarchiveObjectWithData:data]; +#pragma clang diagnostic pop } @catch (NSException *e) { } diff --git a/submodules/LegacyComponents/Sources/TGGameMediaAttachment.m b/submodules/LegacyComponents/Sources/TGGameMediaAttachment.m index 1398827bac..365ff1d221 100644 --- a/submodules/LegacyComponents/Sources/TGGameMediaAttachment.m +++ b/submodules/LegacyComponents/Sources/TGGameMediaAttachment.m @@ -50,7 +50,10 @@ { int32_t length = [is readInt32]; NSData *data = [is readData:length]; - return [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaAttachment class] fromData:data error:nil]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [NSKeyedUnarchiver unarchiveObjectWithData:data]; +#pragma clang diagnostic pop } - (TGWebPageMediaAttachment *)webPageWithText:(NSString *)text entities:(NSArray *)entities { diff --git a/submodules/LegacyComponents/Sources/TGImageMediaAttachment.m b/submodules/LegacyComponents/Sources/TGImageMediaAttachment.m index 68475e272f..a821577240 100644 --- a/submodules/LegacyComponents/Sources/TGImageMediaAttachment.m +++ b/submodules/LegacyComponents/Sources/TGImageMediaAttachment.m @@ -272,7 +272,10 @@ NSData *data = [[NSData alloc] initWithBytesNoCopy:originBytes length:originLength freeWhenDone:true]; TGMediaOriginInfo *origin = nil; @try { - origin = [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaOriginInfo class] fromData:data error:nil]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + origin = [NSKeyedUnarchiver unarchiveObjectWithData:data]; +#pragma clang diagnostic pop } @catch (NSException *e) { } diff --git a/submodules/LegacyComponents/Sources/TGInvoiceMediaAttachment.m b/submodules/LegacyComponents/Sources/TGInvoiceMediaAttachment.m index 8d7f93c434..1d5f1bc4b4 100644 --- a/submodules/LegacyComponents/Sources/TGInvoiceMediaAttachment.m +++ b/submodules/LegacyComponents/Sources/TGInvoiceMediaAttachment.m @@ -89,7 +89,10 @@ { int32_t length = [is readInt32]; NSData *data = [is readData:length]; - return [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaAttachment class] fromData:data error:nil]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [NSKeyedUnarchiver unarchiveObjectWithData:data]; +#pragma clang diagnostic pop } diff --git a/submodules/LegacyComponents/Sources/TGMessageEntitiesAttachment.m b/submodules/LegacyComponents/Sources/TGMessageEntitiesAttachment.m index bce212f7c6..02e8ce7701 100644 --- a/submodules/LegacyComponents/Sources/TGMessageEntitiesAttachment.m +++ b/submodules/LegacyComponents/Sources/TGMessageEntitiesAttachment.m @@ -56,7 +56,10 @@ { int32_t length = [is readInt32]; NSData *data = [is readData:length]; - return [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaAttachment class] fromData:data error:nil]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [NSKeyedUnarchiver unarchiveObjectWithData:data]; +#pragma clang diagnostic pop } @end diff --git a/submodules/LegacyComponents/Sources/TGReplyMarkupAttachment.m b/submodules/LegacyComponents/Sources/TGReplyMarkupAttachment.m index c3caa5d5c7..6a4dac0ad7 100644 --- a/submodules/LegacyComponents/Sources/TGReplyMarkupAttachment.m +++ b/submodules/LegacyComponents/Sources/TGReplyMarkupAttachment.m @@ -66,7 +66,10 @@ { int32_t length = [is readInt32]; NSData *data = [is readData:length]; - return [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaAttachment class] fromData:data error:nil]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [NSKeyedUnarchiver unarchiveObjectWithData:data]; +#pragma clang diagnostic pop } @end diff --git a/submodules/LegacyComponents/Sources/TGViaUserAttachment.m b/submodules/LegacyComponents/Sources/TGViaUserAttachment.m index 25cd60cb4a..51fb7394d8 100644 --- a/submodules/LegacyComponents/Sources/TGViaUserAttachment.m +++ b/submodules/LegacyComponents/Sources/TGViaUserAttachment.m @@ -38,7 +38,10 @@ { int32_t length = [is readInt32]; NSData *data = [is readData:length]; - return [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaAttachment class] fromData:data error:nil]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [NSKeyedUnarchiver unarchiveObjectWithData:data]; +#pragma clang diagnostic pop } @end diff --git a/submodules/LegacyComponents/Sources/TGVideoMediaAttachment.m b/submodules/LegacyComponents/Sources/TGVideoMediaAttachment.m index a16c0159cc..bbf11b0f11 100644 --- a/submodules/LegacyComponents/Sources/TGVideoMediaAttachment.m +++ b/submodules/LegacyComponents/Sources/TGVideoMediaAttachment.m @@ -295,7 +295,10 @@ NSData *data = [[NSData alloc] initWithBytesNoCopy:originBytes length:originLength freeWhenDone:true]; TGMediaOriginInfo *origin = nil; @try { - origin = [NSKeyedUnarchiver unarchivedObjectOfClass:[TGMediaOriginInfo class] fromData:data error:nil]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + origin = [NSKeyedUnarchiver unarchiveObjectWithData:data]; +#pragma clang diagnostic pop } @catch (NSException *e) { } diff --git a/submodules/LegacyComponents/Sources/TGWebPageMediaAttachment.m b/submodules/LegacyComponents/Sources/TGWebPageMediaAttachment.m index 0b3848d453..0550d67ced 100644 --- a/submodules/LegacyComponents/Sources/TGWebPageMediaAttachment.m +++ b/submodules/LegacyComponents/Sources/TGWebPageMediaAttachment.m @@ -160,7 +160,10 @@ int32_t length = [is readInt32]; NSData *data = [is readData:length]; @try { - return [NSKeyedUnarchiver unarchivedObjectOfClass:[TGWebPageMediaAttachment class] fromData:data error:nil]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [NSKeyedUnarchiver unarchiveObjectWithData:data]; +#pragma clang diagnostic pop } @catch (NSException *e) { } return nil; diff --git a/submodules/RMIntro/BUILD b/submodules/RMIntro/BUILD index ac8505a76a..aa3b3ca48a 100644 --- a/submodules/RMIntro/BUILD +++ b/submodules/RMIntro/BUILD @@ -21,6 +21,7 @@ objc_library( copts = [ "-I{}/{}".format(package_name(), directory) for directory in unique_directories(private_headers) ] + [ + "-Werror", "-I{}/PublicHeaders/RMIntro".format(package_name()), ], deps = [ diff --git a/submodules/RMIntro/Sources/core/animations.c b/submodules/RMIntro/Sources/core/animations.c index 6dc53f1ccc..ffe489f997 100644 --- a/submodules/RMIntro/Sources/core/animations.c +++ b/submodules/RMIntro/Sources/core/animations.c @@ -967,7 +967,7 @@ static void draw_ic(int type) t_y -= value*bounce; } - float pink = 0; + __unused float pink = 0; if (time_local > anim_pin_start_time) { pink = t_local(0, 1, anim_pin_start_time, anim_pin_duration, Sin); if (time_local > anim_pin_start_time + anim_pin_duration) { @@ -1285,7 +1285,7 @@ static void draw_ic(int type) // pencil - float begin_k; + __unused float begin_k; if (type == 0) { ic_pos = CPointMake(-88/2-15, -100/2+13); @@ -1387,7 +1387,7 @@ void draw_safe(int type, float alpha, float screw_alpha) float screw_distance = 53; float dk = .1; - float k = dk * 0; + __unused float k = dk * 0; private_screw.params.alpha = alpha * screw_alpha; diff --git a/submodules/RMIntro/Sources/core/objects.c b/submodules/RMIntro/Sources/core/objects.c index 78b912f2cb..8f382a54ca 100644 --- a/submodules/RMIntro/Sources/core/objects.c +++ b/submodules/RMIntro/Sources/core/objects.c @@ -21,6 +21,9 @@ #include #include "animations.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + float scale_factor; int width, height; int y_offset_absolute; @@ -463,7 +466,7 @@ void vec4_log(__unused vec4 M) void draw_shape(const Shape* shape, mat4x4 view_projection_matrix) { - draw_colored_shape(shape, view_projection_matrix, shape->color); + draw_colored_shape(shape, view_projection_matrix, (float *)shape->color); } void draw_colored_shape(const Shape* shape, mat4x4 view_projection_matrix, vec4 color) { @@ -1325,3 +1328,5 @@ void change_rounded_rectangle_stroked(Shape* shape, CSize size, float radius, __ glBindBuffer(GL_ARRAY_BUFFER, 0); } } + +#pragma clang diagnostic pop diff --git a/submodules/RMIntro/Sources/core/program.c b/submodules/RMIntro/Sources/core/program.c index 5779b4b390..e9c7b07dd7 100755 --- a/submodules/RMIntro/Sources/core/program.c +++ b/submodules/RMIntro/Sources/core/program.c @@ -1,7 +1,8 @@ #include "program.h" #include "platform_gl.h" - +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" TextureProgram get_texture_program(GLuint program) { @@ -33,3 +34,5 @@ GradientProgram get_gradient_program(GLuint program) glGetAttribLocation(program, "a_Color"), glGetUniformLocation(program, "u_Alpha")}; } + +#pragma clang diagnostic pop diff --git a/submodules/RMIntro/Sources/core/shader.c b/submodules/RMIntro/Sources/core/shader.c index 068fe05ee7..7dded9671d 100755 --- a/submodules/RMIntro/Sources/core/shader.c +++ b/submodules/RMIntro/Sources/core/shader.c @@ -11,6 +11,9 @@ #define LOGGING_ON 0 #endif +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + static void log_v_fixed_length(const GLchar* source, const GLint length) { if (LOGGING_ON) { char log_buffer[length + 1]; @@ -112,3 +115,5 @@ GLint validate_program(const GLuint program) { return 0; } + +#pragma clang diagnostic pop diff --git a/submodules/RMIntro/Sources/platform/ios/RMIntroViewController.m b/submodules/RMIntro/Sources/platform/ios/RMIntroViewController.m index 7fdabab890..2b2977e44d 100644 --- a/submodules/RMIntro/Sources/platform/ios/RMIntroViewController.m +++ b/submodules/RMIntro/Sources/platform/ios/RMIntroViewController.m @@ -19,6 +19,9 @@ #import +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + typedef enum { Inch35 = 0, Inch4 = 1, @@ -316,7 +319,6 @@ typedef enum { if ([EAGLContext currentContext] == _glkView.context) [EAGLContext setCurrentContext:nil]; - _glkView.context = nil; _context = nil; [_glkView removeFromSuperview]; _glkView = nil; @@ -767,3 +769,5 @@ NSInteger _current_page_end; } @end + +#pragma clang diagnostic pop