Skip to content
2 changes: 1 addition & 1 deletion deps/libz/zutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ extern char z_errmsg[10][21]; /* indexed by 2-zlib_error */
# ifndef Z_SOLO
# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
# include <unix.h> /* for fdopen */
# else
# elif !defined(__APPLE__)
# ifndef fdopen
# define fdopen(fd,mode) NULL /* No fdopen() */
# endif
Expand Down
1 change: 0 additions & 1 deletion gfx/common/metal/Shaders.metal
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,6 @@ namespace hdr
namespace hdr_crt
{
constant float kBeamWidth = 0.5f;
constant uint kChannelMask = 3u;
constant uint kFirstChannelShift = 2u;

constant uint kRedId = 0u;
Expand Down
2 changes: 1 addition & 1 deletion gfx/common/metal_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ typedef NS_ENUM(NSUInteger, ViewportResetMode) {

@interface Filter : NSObject

@property (nonatomic, readwrite) id<FilterDelegate> delegate;
@property (nonatomic, readwrite, assign) id<FilterDelegate> delegate;
@property (nonatomic, readonly) id<MTLSamplerState> sampler;

- (void)apply:(id<MTLCommandBuffer>)cb in:(id<MTLTexture>)tin out:(id<MTLTexture>)tout;
Expand Down
2 changes: 1 addition & 1 deletion gfx/display_servers/dispserv_apple.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static bool apple_display_server_set_window_progress(void *data, int progress, b
* - qb/top-level Makefile: MRC (not in the per-file ARC
* override list at Makefile:275 alongside metal.o /
* mfi_joypad.o / coreaudio3.o).
* - pkg/apple/*.xcodeproj: ARC, via griffin_objc.m which
* - pkg/apple/<anyfile>.xcodeproj: ARC, via griffin_objc.m which
* #include's this file into a TU compiled with
* CLANG_ENABLE_OBJC_ARC=YES (pkg/apple/BaseConfig.xcconfig:182).
*
Expand Down
23 changes: 19 additions & 4 deletions gfx/drivers/gl1.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,14 +840,29 @@ static void gl1_raster_font_render_msg(
font->block->fullscreen = full_screen;

{
unsigned width = gl->video_width;
unsigned height = gl->video_height;
/* gl->video_width/height holds the core's emulated frame size
* (e.g. 256x224), not the window size — gl1 reuses that field
* for texture upload bookkeeping. The font viewport must cover
* the full window, so use screen_width/height instead. Fall
* back to video_width/height if the context driver did not
* report a screen size yet. */
unsigned width = gl->screen_width
? gl->screen_width : gl->video_width;
unsigned height = gl->screen_height
? gl->screen_height : gl->video_height;
float inv_tex_size_x = 1.0f / font->tex_width;
float inv_tex_size_y = 1.0f / font->tex_height;
float inv_win_width = 1.0f / gl->vp.width;
float inv_win_height = 1.0f / gl->vp.height;
float inv_win_width;
float inv_win_height;
/* setup_viewport may change gl->vp, so capture inv_win_width/height
* AFTER it runs — otherwise the vertex math uses one viewport while
* the actual glViewport is another, producing stretched/squished
* text. The block path defers setup_viewport to flush time and uses
* gl->vp as-is. */
if (!font->block)
gl1_raster_font_setup_viewport(gl, width, height, font, full_screen);
inv_win_width = 1.0f / gl->vp.width;
inv_win_height = 1.0f / gl->vp.height;

if (msg && *msg
&& font->font_data && font->font_driver)
Expand Down
4 changes: 2 additions & 2 deletions gfx/drivers/metal.m
Original file line number Diff line number Diff line change
Expand Up @@ -4300,7 +4300,7 @@ - (void)drawWithEncoder:(id<MTLRenderCommandEncoder>)rce

- (void)drawWithContext:(Context *)ctx
{
int i;
size_t i;
_texture = _engine.frame.texture[0].view;

if ( (_format != RPixelFormatBGRA8Unorm)
Expand Down Expand Up @@ -4938,7 +4938,7 @@ - (bool)loadImages:(const struct texture_image *)images count:(NSUInteger)count

- (void)drawWithEncoder:(id<MTLRenderCommandEncoder>)rce
{
int i;
size_t i;
NSUInteger count;
#if !defined(HAVE_COCOATOUCH)
if (_vertDirty)
Expand Down
4 changes: 3 additions & 1 deletion gfx/drivers_context/cocoa_gl_ctx.m
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,10 @@ static bool cocoa_gl_gfx_ctx_set_video_mode(void *data,
CocoaView *g_view = (CocoaView*)nsview_get_ptr();
#endif
cocoa_ctx_data_t *cocoa_ctx = (cocoa_ctx_data_t*)data;
#ifndef HAVE_COCOA_METAL
static bool
has_went_fullscreen = false;
#endif
cocoa_ctx->width = width;
cocoa_ctx->height = height;

Expand Down Expand Up @@ -605,9 +607,9 @@ static bool cocoa_gl_gfx_ctx_set_video_mode(void *data,

[[g_view window] setContentSize:NSMakeSize(width, height)];
}
#endif

has_went_fullscreen = fullscreen;
#endif

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion gfx/drivers_context/cocoa_vk_ctx.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static void cocoa_vk_gfx_ctx_swap_interval(void *data, int i)
unsigned interval = (unsigned)i;
cocoa_vk_ctx_data_t *cocoa_ctx = (cocoa_vk_ctx_data_t*)data;

if (cocoa_ctx->swap_interval != interval)
if (cocoa_ctx->swap_interval != (int)interval)
{
cocoa_ctx->swap_interval = interval;
if (cocoa_ctx->vk.swapchain)
Expand Down
4 changes: 3 additions & 1 deletion libretro-common/include/net/net_http.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ bool net_http_error(struct http_t *state);
*
* @return the response headers. The returned buffer is owned by the
* caller of net_http_new; it is not freed by net_http_delete.
* If the status is not 20x and accept_error is false, it returns NULL.
* On a transport error, NULL is returned unless accept_error is true.
* Headers are returned for any response that was parsed successfully,
* including HTTP error statuses such as 401 (needed for auth challenges).
**/
struct string_list *net_http_headers(struct http_t *state);
struct string_list *net_http_headers_ex(struct http_t *state, bool accept_error);
Expand Down
12 changes: 7 additions & 5 deletions libretro-common/net/net_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ static ssize_t net_http_receive_header(struct http_t *state, ssize_t len)
{
len = response->pos;
response->pos = 0;
if (response->bodytype == T_LEN)
if (response->bodytype == T_LEN && response->len > 0)
{
/* Use a tmp pointer so a realloc failure does not leak the
* original buffer AND leave response->data NULL for later
Expand Down Expand Up @@ -1428,7 +1428,7 @@ static bool net_http_receive_body(struct http_t *state, ssize_t newlen)
if (response->bodytype != T_FULL)
return false;
response->part = P_DONE;
if (response->buflen != response->len)
if (response->buflen != response->len && response->len > 0)
{
/* Shrink response->data from buflen bytes to len bytes.
* Use a tmp pointer so a realloc() failure (rare on shrink
Expand Down Expand Up @@ -1535,7 +1535,7 @@ static bool net_http_receive_body(struct http_t *state, ssize_t newlen)
else if (response->pos == response->len)
{
response->part = P_DONE;
if (response->buflen != response->len)
if (response->buflen != response->len && response->len > 0)
{
char *tmp = (char*)realloc(response->data, response->len);
if (!tmp)
Expand Down Expand Up @@ -1804,13 +1804,15 @@ int net_http_status(struct http_t *state)
*
* @return the response headers. The returned buffer is owned by the
* caller of net_http_new; it is not freed by net_http_delete().
* If the status is not 20x and accept_err is false, it returns NULL.
* On a transport error, NULL is returned unless accept_err is true.
* Headers are returned for any response that was parsed successfully,
* including HTTP error statuses such as 401 (needed for auth challenges).
**/
struct string_list *net_http_headers_ex(struct http_t *state, bool accept_err)
{
if (!state)
return NULL;
if (!accept_err && !state->err)
if (!accept_err && state->err)
return NULL;
return state->response.headers;
}
Expand Down
2 changes: 2 additions & 0 deletions qb/config.libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ if [ "$OS" = 'BSD' ]; then
[ -d /usr/local/include ] && add_dirs INCLUDE /usr/local/include
[ -d /usr/local/lib ] && add_dirs LIBRARY /usr/local/lib
DYLIB=-lc;
elif [ "$OS" = 'Darwin' ]; then
DYLIB=
elif [ "$OS" = 'Haiku' ]; then
DYLIB=""
CLIB=-lroot
Expand Down
2 changes: 1 addition & 1 deletion ui/drivers/cocoa/cocoa_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void get_ios_version(int *major, int *minor);
#endif

#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 140000
@property(nonatomic,readwrite) CADisplayLink *displayLink API_AVAILABLE(macos(14.0));
@property(nonatomic,readwrite,retain) CADisplayLink *displayLink API_AVAILABLE(macos(14.0));
#endif

@end
Expand Down
2 changes: 1 addition & 1 deletion ui/drivers/ui_cocoa.m
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ - (void)dealloc

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
unsigned i;
int i;
apple_platform = self;
[self.window setAcceptsMouseMovedEvents: YES];

Expand Down
Loading