Skip to content

Commit ff6e64b

Browse files
committed
minor update to process msgpack
1 parent a4be125 commit ff6e64b

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

jdatadecode.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,10 @@
105105
end
106106
ndata=cast(data(j).(N_('_ArrayData_')),char(data(j).(N_('_ArrayType_'))));
107107
end
108-
if(~isempty(strmatch(N_('_ArrayZipSize_'),fn)))
109-
ndata=reshape(ndata(:),data(j).(N_('_ArrayZipSize_')));
110-
end
108+
if(~isempty(strmatch(N_('_ArrayZipSize_'),fn)))
109+
ndata=reshape(ndata(:),fliplr(data(j).(N_('_ArrayZipSize_'))(:)'));
110+
ndata=permute(ndata,ndims(ndata):-1:1);
111+
end
111112
iscpx=0;
112113
if(~isempty(strmatch(N_('_ArrayIsComplex_'),fn)))
113114
if(data(j).(N_('_ArrayIsComplex_')))

jsonopt.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@
2424
%
2525

2626
val=default;
27-
if(nargin<=2) return; end
27+
if(nargin<=2)
28+
return;
29+
end
2830
opt=varargin{1};
2931
if(isstruct(opt))
3032
if(isfield(opt,key))
31-
val=getfield(opt,key);
33+
val=opt.(key);
3234
elseif(isfield(opt,lower(key)))
33-
val=getfield(opt,lower(key));
35+
val=opt.(lower(key));
3436
end
3537
end

saveubjson.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,9 @@
530530
fulldata=[ix,iy,data];
531531
end
532532
if(ismsgpack)
533-
txt=[txt,N_('_ArrayZipSize_'),I_a(size(fulldata))];
533+
cid=I_(uint32(max(size(fulldata))),Imarker,varargin{:});
534+
txt=[txt,N_('_ArrayZipSize_'),I_a(size(fulldata),cid(1),Imarker,varargin{:})];
535+
childcount=childcount+1;
534536
end
535537
varargin{:}.ArrayToStruct=0;
536538
txt=[txt,N_('_ArrayData_'),...
@@ -562,6 +564,7 @@
562564
if(ismsgpack)
563565
cid=I_(uint32(length(item(:))),Imarker,varargin{:});
564566
txt=[txt,N_('_ArrayZipSize_'),I_a([~isreal(item)+1 length(item(:))],cid(1),Imarker,varargin{:})];
567+
childcount=childcount+1;
565568
end
566569
if(isreal(item))
567570
txt=[txt,N_('_ArrayData_'),...
@@ -641,11 +644,9 @@
641644
end
642645

643646
type='';
644-
hasnegtive=(mat<0);
645647

646-
varargin{:}.num2cell_=1;
647648
if(isa(mat,'integer') || isinteger(mat) || (isfloat(mat) && all(mod(mat(:),1) == 0)))
648-
if(isempty(hasnegtive))
649+
if(~any(mat<0))
649650
if(max(mat(:))<=2^8)
650651
type=Imarker(1);
651652
end

0 commit comments

Comments
 (0)