History

lavu/vulkan: avoid using strlen as a loop condition

Whatever.

Lynne committed 4 years ago

Commit 9e2deba1 parent 82ef4c71 file · +2 −1Browse files

Unified · Split

libavutil/vulkan.c+2−1
@@ -829,11 +829,12 @@ void ff_vk_print_shader(void *ctx, FFVkSPIRVShader *shd, int prio) · 828 unmodified lines
829 int line = 0;829 int line = 0;
830 const char *p = shd->src.str;830 const char *p = shd->src.str;
831 const char *start = p;831 const char *start = p;
832 const size_t len = strlen(p);
832 833
833 AVBPrint buf;834 AVBPrint buf;
834 av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);835 av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
835 836
836 for (int i = 0; i < strlen(p); i++) {837 for (int i = 0; i < len; i++) {
837 if (p[i] == '\n') {838 if (p[i] == '\n') {
838 av_bprintf(&buf, "%i\t", ++line);839 av_bprintf(&buf, "%i\t", ++line);
839 av_bprint_append_data(&buf, start, &p[i] - start + 1);840 av_bprint_append_data(&buf, start, &p[i] - start + 1);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t