Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc c99 style 2 #2993

Merged
merged 2 commits into from
Aug 18, 2023
Merged

Misc c99 style 2 #2993

merged 2 commits into from
Aug 18, 2023

Conversation

cgwalters
Copy link
Member

lzma: Port to C99 style

Just keeping up momentum.


checkout: Port to C99 style

Just keeping up momentum.


Just keeping up momentum.
@@ -293,37 +290,33 @@ process_many_checkouts (OstreeRepo *repo, const char *target, GCancellable *canc

/* Read the null byte */
(void)g_data_input_stream_read_byte (datastream, cancellable, NULL);
g_free (subpath);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good example of why C99 is better, declare when you need helps prevent silliness like this.

Copy link
Collaborator

@ericcurtin ericcurtin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


*bytes_read = inbuf_size - self->lstream.avail_in;
*bytes_written = outbuf_size - self->lstream.avail_out;

out:
return _ostree_lzma_return (res, error);
return G_CONVERTER_CONVERTED;
Copy link
Collaborator

@ericcurtin ericcurtin Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be _ostree_lzma_return (res, error), it wasn't guaranteed to be G_CONVERTER_CONVERTED before, as we only check for certain values before this, maybe the goto makes sense here tbh... Duplicating the _ostree_lzma_return is ok too though...

Just keeping up momentum.
@ericcurtin ericcurtin merged commit ee1e585 into ostreedev:main Aug 18, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants