Skip to content

Commit f526d12

Browse files
committed
Merge branch 'maint'
* maint: msvc: Fix some compiler warnings Documentation: grep: fix asciidoc problem with -- msvc: Fix some "expr evaluates to function" compiler warnings
2 parents ba4d01b + 9eafa12 commit f526d12

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

Documentation/git-grep.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ OPTIONS
183183
Examples
184184
--------
185185

186-
git grep 'time_t' -- '*.[ch]'::
186+
git grep 'time_t' \-- '*.[ch]'::
187187
Looks for `time_t` in all tracked .c and .h files in the working
188188
directory and its subdirectories.
189189

block-sha1/sha1.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,13 @@ void blk_SHA1_Init(blk_SHA_CTX *ctx)
236236

237237
void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *data, unsigned long len)
238238
{
239-
int lenW = ctx->size & 63;
239+
unsigned int lenW = ctx->size & 63;
240240

241241
ctx->size += len;
242242

243243
/* Read the data into W and process blocks as they get full */
244244
if (lenW) {
245-
int left = 64 - lenW;
245+
unsigned int left = 64 - lenW;
246246
if (len < left)
247247
left = len;
248248
memcpy(lenW + (char *)ctx->W, data, left);
@@ -269,8 +269,8 @@ void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx)
269269
int i;
270270

271271
/* Pad with a binary 1 (ie 0x80), then zeroes, then length */
272-
padlen[0] = htonl(ctx->size >> 29);
273-
padlen[1] = htonl(ctx->size << 3);
272+
padlen[0] = htonl((uint32_t)(ctx->size >> 29));
273+
padlen[1] = htonl((uint32_t)(ctx->size << 3));
274274

275275
i = ctx->size & 63;
276276
blk_SHA1_Update(ctx, pad, 1+ (63 & (55 - i)));

builtin.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ struct notes_rewrite_cfg {
2323
struct notes_tree **trees;
2424
const char *cmd;
2525
int enabled;
26-
combine_notes_fn *combine;
26+
combine_notes_fn combine;
2727
struct string_list *refs;
2828
int refs_from_env;
2929
int mode_from_env;
3030
};
3131

32-
combine_notes_fn *parse_combine_notes_fn(const char *v);
32+
combine_notes_fn parse_combine_notes_fn(const char *v);
3333
struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd);
3434
int copy_note_for_rewrite(struct notes_rewrite_cfg *c,
3535
const unsigned char *from_obj, const unsigned char *to_obj);

builtin/notes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ int commit_notes(struct notes_tree *t, const char *msg)
313313
return 0;
314314
}
315315

316-
combine_notes_fn *parse_combine_notes_fn(const char *v)
316+
combine_notes_fn parse_combine_notes_fn(const char *v)
317317
{
318318
if (!strcasecmp(v, "overwrite"))
319319
return combine_notes_overwrite;

notes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* combine_notes_concatenate(), which appends the contents of the new note to
1919
* the contents of the existing note.
2020
*/
21-
typedef int combine_notes_fn(unsigned char *cur_sha1, const unsigned char *new_sha1);
21+
typedef int (*combine_notes_fn)(unsigned char *cur_sha1, const unsigned char *new_sha1);
2222

2323
/* Common notes combinators */
2424
int combine_notes_concatenate(unsigned char *cur_sha1, const unsigned char *new_sha1);
@@ -38,7 +38,7 @@ extern struct notes_tree {
3838
struct int_node *root;
3939
struct non_note *first_non_note, *prev_non_note;
4040
char *ref;
41-
combine_notes_fn *combine_notes;
41+
combine_notes_fn combine_notes;
4242
int initialized;
4343
int dirty;
4444
} default_notes_tree;

0 commit comments

Comments
 (0)