Mercurial > vim
comparison src/crypt.c @ 16782:fc58fee685e2 v8.1.1393
patch 8.1.1393: unnecessary type casts
commit https://github.com/vim/vim/commit/51e14387f120392b74b84408cafec33942337a05
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 25 20:21:28 2019 +0200
patch 8.1.1393: unnecessary type casts
Problem: Unnecessary type casts.
Solution: Remove type casts from alloc() and lalloc() calls. (Mike Williams)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 25 May 2019 20:30:06 +0200 |
parents | a1229400434a |
children | ce04ebdf26b8 |
comparison
equal
deleted
inserted
replaced
16781:db5dc8db015c | 16782:fc58fee685e2 |
---|---|
252 char_u *salt, | 252 char_u *salt, |
253 int salt_len, | 253 int salt_len, |
254 char_u *seed, | 254 char_u *seed, |
255 int seed_len) | 255 int seed_len) |
256 { | 256 { |
257 cryptstate_T *state = (cryptstate_T *)alloc((int)sizeof(cryptstate_T)); | 257 cryptstate_T *state = (cryptstate_T *)alloc(sizeof(cryptstate_T)); |
258 | 258 |
259 if (state == NULL) | 259 if (state == NULL) |
260 return state; | 260 return state; |
261 | 261 |
262 state->method_nr = method_nr; | 262 state->method_nr = method_nr; |
405 return method->encode_buffer_fn(state, from, len, newptr); | 405 return method->encode_buffer_fn(state, from, len, newptr); |
406 if (len == 0) | 406 if (len == 0) |
407 /* Not buffering, just return EOF. */ | 407 /* Not buffering, just return EOF. */ |
408 return (long)len; | 408 return (long)len; |
409 | 409 |
410 *newptr = alloc((long)len); | 410 *newptr = alloc(len); |
411 if (*newptr == NULL) | 411 if (*newptr == NULL) |
412 return -1; | 412 return -1; |
413 method->encode_fn(state, from, len, *newptr); | 413 method->encode_fn(state, from, len, *newptr); |
414 return (long)len; | 414 return (long)len; |
415 } | 415 } |