/* util.c generated by valac 0.56.19, the Vala compiler
 * generated from util.vala, do not modify */

/* Breaks a uint64 skip amount into several smaller skips.*/

#include "shotwell-internal-video-metadata-handling.h"
#include <gio/gio.h>
#include <glib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

void
skip_uint64 (GInputStream* input,
             guint64 skip_amount,
             GError** error)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (input, g_input_stream_get_type ()));
	while (TRUE) {
		if (!(skip_amount > ((guint64) 0))) {
			break;
		}
		if (skip_amount >= ((guint64) G_MAXSSIZE)) {
			g_input_stream_skip (input, (gsize) G_MAXSSIZE, NULL, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				g_propagate_error (error, _inner_error0_);
				return;
			}
			skip_amount = skip_amount - G_MAXSSIZE;
		} else {
			g_input_stream_skip (input, (gsize) skip_amount, NULL, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				g_propagate_error (error, _inner_error0_);
				return;
			}
			skip_amount = (guint64) 0;
		}
	}
}

