Jan Breuer
2013-03-05 7da9313107fbfc41f3eb86629a4590e7f6ccb66e
Correct possible bugs (compiller warnings)
3个文件已修改
26 ■■■■ 已修改文件
libscpi/src/debug.c 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
libscpi/src/ieee488.c 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
libscpi/src/utils.c 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
libscpi/src/debug.c
@@ -47,7 +47,7 @@
    printf("**DEBUG: %s (\"", context->paramlist.cmd->pattern);
    res = fwrite(context->paramlist.parameters, 1, context->paramlist.length, stdout);
    (void)res;
    printf("\" - %ld)\r\n", context->paramlist.length);
    printf("\" - %ld\r\n", (uint32_t)context->paramlist.length);
    
    return TRUE;
}
libscpi/src/ieee488.c
@@ -64,8 +64,10 @@
static size_t writeControl(scpi_t * context, int ctrl, scpi_reg_val_t val) {
    if (context && context->interface && context->interface->control) {
        context->interface->control(context, ctrl, val);
    }
        return context->interface->control(context, ctrl, val);
    } else {
        return 0;
    }
}
/**
libscpi/src/utils.c
@@ -163,7 +163,7 @@
    for (i = 0; i < len1; i++) {
        if ((strStart < 0) && isspace(str1[i])) {
        if ((strStart < 0) && isspace((unsigned char)str1[i])) {
            continue;
        }
@@ -186,15 +186,15 @@
            break;
        }
        if ((strStop >= 0) && quot && !isspace(str1[i])) {
        if ((strStop >= 0) && quot && !isspace((unsigned char)str1[i])) {
            valid = 0;
        }
        if (!quot && !isspace(str1[i]) && (str1[i] != ',')) {
        if (!quot && !isspace((unsigned char)str1[i]) && (str1[i] != ',')) {
            strStop = i;
        }
        if (isspace(str1[i])) {
        if (isspace((unsigned char)str1[i])) {
            continue;
        }
@@ -240,7 +240,7 @@
    for (i = 0; i < len1; i++) {
        if ((strStart < 0) && isspace(str1[i])) {
        if ((strStart < 0) && isspace((unsigned char)str1[i])) {
            continue;
        }
@@ -248,11 +248,11 @@
            strStart = i;
        }
        if (!isspace(str1[i]) && (str1[i] != ',')) {
        if (!isspace((unsigned char)str1[i]) && (str1[i] != ',')) {
            strStop = i;
        }
        if (isspace(str1[i])) {
        if (isspace((unsigned char)str1[i])) {
            continue;
        }
@@ -303,7 +303,7 @@
size_t skipWhitespace(const char * cmd, size_t len) {
    size_t i;
    for (i = 0; i < len; i++) {
        if (!isspace(cmd[i])) {
        if (!isspace((unsigned char)cmd[i])) {
            return i;
        }
    }
@@ -321,7 +321,7 @@
size_t patternSeparatorShortPos(const char * pattern, size_t len) {
    size_t i;
    for (i = 0; (i < len) && pattern[i]; i++) {
        if (islower(pattern[i])) {
        if (islower((unsigned char)pattern[i])) {
            return i;
        }
    }