[z88dk-dev] appmake mod

Bridge to the z88dk-developers mailing list
Post Reply
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

[z88dk-dev] appmake mod

Post by alvin »

Maybe you can have a look to make sure the following modification to appmake.c is still keeping with intentions.

Original:

Code: Select all

117             for ( i = 0; i < argc; i++ ) {
118
119                 if ( argv[i][0] == '+' ) {
120
121                     if ( target != NULL ) {
122
123                         execute_command(target, ac, av, 1);
124
125                     }
126
127                     target = &argv[i][1];
128
129                     ac = 0;
130
131                 } else {
132
133                     av[ac] = argv[i];
134
135                     ac++;
136
137                 }
138
139             }
New:

Code: Select all

118             for ( i = 0; i < argc; i++ ) {
119
120                 if ( argv[i][0] == '+' ) {
121
122                     if ( target != NULL ) {
123
124                         execute_command(target, ac, av, 1);
125
126                         ac = 0;
127                         memset(av, 0, argc * sizeof(char*));
128
129                     }
130
131                     target = &argv[i][1];
132
133                 } else {
134
135                     av[ac] = argv[i];
136
137                     ac++;
138
139                 }
140
141             }
There are two differences. One is if the first +machinename parameter is encountered in the middle of other options, the already seen options are not ignored by setting ac=0. The other is if more than one +machinename parameter is encountered, the command is executed and the next command line is completely zeroed, not just by setting ac=0 but also by memsetting to av array to 0.



------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/ ... 1&iu=/4140
User avatar
dom
Well known member
Posts: 2091
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

Maybe you can have a look to make sure the following modification to appmake.c is still keeping with intentions.

There are two differences. One is if the first +machinename parameter is encountered in the middle of other options, the already seen options are not ignored by setting ac=0. The other is if more than one +machinename parameter is encountered, the command is executed and the next command line is completely zeroed, not just by setting ac=0 but also by memsetting to av array to 0.
I think that's ok - we should be able to chain multiple targets together. I should probably fix the building of the arguments by zcc so that this situation doesn't arise.



------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/ ... 1&iu=/4140
Post Reply