From 61fe41c722d1062ddafcbef9edaeaeba4f084529 Mon Sep 17 00:00:00 2001
From: Jan Breuer <jan.breuer@jaybee.cz>
Date: 周一, 07 9月 2015 01:05:59 +0800
Subject: [PATCH] Cleanup documentation

---
 libscpi/src/lexer.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/libscpi/src/lexer.c b/libscpi/src/lexer.c
index e7dc48d..aaca475 100644
--- a/libscpi/src/lexer.c
+++ b/libscpi/src/lexer.c
@@ -245,7 +245,7 @@
  * @param chr
  * @return 
  */
-static int skipChr(lex_state_t * state, int chr) {
+static int skipChr(lex_state_t * state, char chr) {
     if (!iseos(state) && ischr(state, chr)) {
         state->pos++;
         return SKIP_OK;
@@ -506,7 +506,7 @@
  * @return 
  */
 int scpiLex_DecimalNumericProgramData(lex_state_t * state, scpi_token_t * token) {
-    const char * rollback;
+    char * rollback;
     token->ptr = state->pos;
 
     if (skipMantisa(state)) {
@@ -594,8 +594,8 @@
  * @return 
  */
 int scpiLex_NondecimalNumericData(lex_state_t * state, scpi_token_t * token) {
-    token->ptr = state->pos;
     int someNumbers = 0;
+    token->ptr = state->pos;
     if (skipChr(state, '#')) {
         if (!iseos(state)) {
             if (isH(state->pos[0])) {
@@ -630,7 +630,7 @@
     return (c >= 0) && (c <= 0x7f);
 }
 
-static int skipQuoteProgramData(lex_state_t * state, int quote) {
+static void skipQuoteProgramData(lex_state_t * state, char quote) {
     while (!iseos(state)) {
         if (isascii7bit(state->pos[0]) && !ischr(state, quote)) {
             state->pos++;
@@ -646,11 +646,11 @@
     }
 }
 
-static int skipDoubleQuoteProgramData(lex_state_t * state) {
+static void skipDoubleQuoteProgramData(lex_state_t * state) {
     skipQuoteProgramData(state, '"');
 }
 
-static int skipSingleQuoteProgramData(lex_state_t * state) {
+static void skipSingleQuoteProgramData(lex_state_t * state) {
     skipQuoteProgramData(state, '\'');
 }
 
@@ -690,15 +690,15 @@
     token->len = state->pos - token->ptr;
 
     if ((token->len > 0)) {
-        token->ptr++;
-        token->len -= 2;
+        //token->ptr++;
+        //token->len -= 2;
     } else {
         token->type = SCPI_TOKEN_UNKNOWN;
         state->pos = token->ptr;
         token->len = 0;
     }
 
-    return token->len > 0 ? token->len + 2 : 0;
+    return token->len > 0 ? token->len : 0;
 }
 
 /* 7.7.6 <ARBITRARY BLOCK PROGRAM DATA> */
@@ -716,8 +716,8 @@
     int i;
     int arbitraryBlockLength = 0;
     const char * ptr = state->pos;
-    token->ptr = state->pos;
     int validData = -1;
+    token->ptr = state->pos;
 
     if (skipChr(state, '#')) {
         if (!iseos(state) && isNonzeroDigit(state->pos[0])) {

--
Gitblit v1.9.1