modify dec API from void to explicit type

for master.
same as #883.