Commit Diff


commit - a06cc1769a79f0a8c57415f858a97e2cef174c9e
commit + 7bde78c773e37dfb09e00ea709dc283cf34fd38d
blob - 521a59b5c000b2bebe415e6a979baf6a012f97fe
blob + 2f0d48e892f5b82bdd063b39c87703ce616ab898
--- gen.c
+++ gen.c
@@ -389,7 +389,7 @@ void decode (FILE *out, size_t *offset, struct type *t
 
 void print_decode (FILE *out, struct structure *st)
 {
-	fprintf (out, "void decode_%s (struct %s *out, uint8_t *in)\n{\n", st->name, st->name);
+	fprintf (out, "void decode_%s (struct %s *out, const uint8_t *in)\n{\n", st->name, st->name);
 
 	size_t offset = 0;
 
@@ -409,7 +409,7 @@ void print_decode (FILE *out, struct structure *st)
 void declare (FILE *out, struct structure *st)
 {
 	fprintf (out, "void encode_%s (uint8_t *out, const struct %s *in);\n", st->name, st->name);
-	fprintf (out, "void decode_%s (struct %s *out, uint8_t *in);\n", st->name, st->name);
+	fprintf (out, "void decode_%s (struct %s *out, const uint8_t *in);\n", st->name, st->name);
 }
 
 static const char *header =