Mercurial > vim
comparison src/channel.c @ 20751:d9a2e5dcfd9f v8.2.0928
patch 8.2.0928: many type casts are used for vim_strnsave()
Commit: https://github.com/vim/vim/commit/df44a27b53586fccfc6a3aedc89061fdd9a515ff
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 7 20:49:05 2020 +0200
patch 8.2.0928: many type casts are used for vim_strnsave()
Problem: Many type casts are used for vim_strnsave().
Solution: Make the length argument size_t instead of int. (Ken Takata,
closes #5633) Remove some type casts.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 07 Jun 2020 21:00:03 +0200 |
parents | 5f0f1f63c8df |
children | 2c40e60017a8 |
comparison
equal
deleted
inserted
replaced
20750:020a100bfa92 | 20751:d9a2e5dcfd9f |
---|---|
2904 } | 2904 } |
2905 else | 2905 else |
2906 { | 2906 { |
2907 // Copy the message into allocated memory (excluding the NL) | 2907 // Copy the message into allocated memory (excluding the NL) |
2908 // and remove it from the buffer (including the NL). | 2908 // and remove it from the buffer (including the NL). |
2909 msg = vim_strnsave(buf, (int)(nl - buf)); | 2909 msg = vim_strnsave(buf, nl - buf); |
2910 channel_consume(channel, part, (int)(nl - buf) + 1); | 2910 channel_consume(channel, part, (int)(nl - buf) + 1); |
2911 } | 2911 } |
2912 } | 2912 } |
2913 else | 2913 else |
2914 { | 2914 { |
3701 } | 3701 } |
3702 else | 3702 else |
3703 { | 3703 { |
3704 // Copy the message into allocated memory and remove it from the | 3704 // Copy the message into allocated memory and remove it from the |
3705 // buffer. | 3705 // buffer. |
3706 msg = vim_strnsave(buf, (int)(nl - buf)); | 3706 msg = vim_strnsave(buf, nl - buf); |
3707 channel_consume(channel, part, (int)(nl - buf) + 1); | 3707 channel_consume(channel, part, (int)(nl - buf) + 1); |
3708 } | 3708 } |
3709 } | 3709 } |
3710 if (ch_log_active()) | 3710 if (ch_log_active()) |
3711 ch_log(channel, "Returning %d bytes", (int)STRLEN(msg)); | 3711 ch_log(channel, "Returning %d bytes", (int)STRLEN(msg)); |