Skip to content

Commit

Permalink
feat: reduce some c codes
Browse files Browse the repository at this point in the history
  • Loading branch information
xhaidong committed Mar 21, 2023
1 parent 04c901d commit e9146fd
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 1,712 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"rtcm.h": "c",
"stdarg.h": "c",
"time.h": "c",
"dirent.h": "c"
"dirent.h": "c",
"rtkcmn.h": "c"
}
}
1 change: 1 addition & 0 deletions rtcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
* use integer types in stdint.h
*-----------------------------------------------------------------------------*/
#include "rtcm.h"
#include "rtkcmn.h"

/* constants -----------------------------------------------------------------*/

Expand Down
8 changes: 5 additions & 3 deletions rtcm.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package rtcm

//#cgo CFLAGS: -DENAGLO -DENAGAL -DENAQZS -DENACMP -DENAIRN
//
//#include "rtcm.h"
/*
#cgo CFLAGS: -I./ -DENAGLO -DENAGAL -DENAQZS -DENACMP -DENAIRN
#include "rtcm.h"
*/
import "C"
import (
"errors"
Expand Down
663 changes: 0 additions & 663 deletions rtcm.h

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions rtcm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package rtcm

import (
"fmt"
"io/ioutil"
"os"
"testing"
)

Expand Down Expand Up @@ -30,7 +30,7 @@ func TestCdecode(t *testing.T) {
msgType := msgType

file := fmt.Sprintf("%d_frame.bin", msgType)
data, err := ioutil.ReadFile("./data/" + file)
data, err := os.ReadFile("./data/" + file)
if err != nil {
t.Error(err)
}
Expand All @@ -55,7 +55,7 @@ func TestDecode(t *testing.T) {
msgType := msgType

file := fmt.Sprintf("%d_frame.bin", msgType)
data, err := ioutil.ReadFile("./data/" + file)
data, err := os.ReadFile("./data/" + file)
if err != nil {
t.Error(err)
}
Expand Down
Loading

0 comments on commit e9146fd

Please sign in to comment.