Skip to content
Snippets Groups Projects
Commit 956e000b authored by Qianqian Fang's avatar Qianqian Fang
Browse files

drop octave 3.x support, fix ubjson error in octave

parent e090f0a5
No related branches found
No related tags found
No related merge requests found
...@@ -154,11 +154,7 @@ function [data, adv]=parse_block(type,count,varargin) ...@@ -154,11 +154,7 @@ function [data, adv]=parse_block(type,count,varargin)
global pos inStr isoct fileendian systemendian global pos inStr isoct fileendian systemendian
[cid,len]=elem_info(type); [cid,len]=elem_info(type);
datastr=inStr(pos:pos+len*count-1); datastr=inStr(pos:pos+len*count-1);
if(isoct)
newdata=int8(datastr);
else
newdata=uint8(datastr); newdata=uint8(datastr);
end
id=strfind('iUIlLdD',type); id=strfind('iUIlLdD',type);
if(fileendian~=systemendian) if(fileendian~=systemendian)
newdata=swapbytes(typecast(newdata,cid)); newdata=swapbytes(typecast(newdata,cid));
...@@ -309,11 +305,7 @@ function num = parse_number(varargin) ...@@ -309,11 +305,7 @@ function num = parse_number(varargin)
type={'int8','uint8','int16','int32','int64','single','double'}; type={'int8','uint8','int16','int32','int64','single','double'};
bytelen=[1,1,2,4,8,4,8]; bytelen=[1,1,2,4,8,4,8];
datastr=inStr(pos+1:pos+bytelen(id)); datastr=inStr(pos+1:pos+bytelen(id));
if(isoct)
newdata=int8(datastr);
else
newdata=uint8(datastr); newdata=uint8(datastr);
end
if(fileendian~=systemendian) if(fileendian~=systemendian)
newdata=swapbytes(typecast(newdata,type{id})); newdata=swapbytes(typecast(newdata,type{id}));
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment